Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Use CACHE_LINE_SIZE for EHCI_SQTD_ALIGN to make ...



details:   https://anonhg.NetBSD.org/src/rev/e29ba8e1b213
branches:  trunk
changeset: 784575:e29ba8e1b213
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Feb 02 14:15:55 2013 +0000

description:
Use CACHE_LINE_SIZE for EHCI_SQTD_ALIGN to make sure the sqtd fully consume
a cacheline.

diffstat:

 sys/dev/usb/ehcivar.h |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 4f460f34db6d -r e29ba8e1b213 sys/dev/usb/ehcivar.h
--- a/sys/dev/usb/ehcivar.h     Sat Feb 02 14:11:37 2013 +0000
+++ b/sys/dev/usb/ehcivar.h     Sat Feb 02 14:15:55 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehcivar.h,v 1.41 2013/01/29 00:00:15 christos Exp $ */
+/*     $NetBSD: ehcivar.h,v 1.42 2013/02/02 14:15:55 matt Exp $ */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,7 +44,8 @@
        LIST_ENTRY(ehci_soft_qtd) hnext;
        u_int16_t len;
 } ehci_soft_qtd_t;
-#define EHCI_SQTD_SIZE ((sizeof (struct ehci_soft_qtd) + EHCI_QTD_ALIGN - 1) / EHCI_QTD_ALIGN * EHCI_QTD_ALIGN)
+#define EHCI_SQTD_ALIGN        MAX(EHCI_QTD_ALIGN, CACHE_LINE_SIZE)
+#define EHCI_SQTD_SIZE ((sizeof (struct ehci_soft_qtd) + EHCI_SQTD_ALIGN - 1) & -EHCI_SQTD_ALIGN)
 #define EHCI_SQTD_CHUNK (EHCI_PAGE_SIZE / EHCI_SQTD_SIZE)
 
 typedef struct ehci_soft_qh {



Home | Main Index | Thread Index | Old Index