Module Name: src
Committed By: phx
Date: Sun May 2 13:36:31 UTC 2010
Modified Files:
src/sys/arch/sandpoint/stand/netboot: fxp.c kse.c nvt.c pcn.c rge.c
sip.c sme.c tlp.c vge.c wm.c
Log Message:
Fixed ALLOC() macro to allocate properly aligned memory.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sandpoint/stand/netboot/fxp.c \
src/sys/arch/sandpoint/stand/netboot/wm.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/netboot/kse.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sandpoint/stand/netboot/nvt.c \
src/sys/arch/sandpoint/stand/netboot/vge.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sandpoint/stand/netboot/pcn.c \
src/sys/arch/sandpoint/stand/netboot/rge.c \
src/sys/arch/sandpoint/stand/netboot/sip.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/netboot/sme.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sandpoint/stand/netboot/tlp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sandpoint/stand/netboot/fxp.c
diff -u src/sys/arch/sandpoint/stand/netboot/fxp.c:1.10 src/sys/arch/sandpoint/stand/netboot/fxp.c:1.11
--- src/sys/arch/sandpoint/stand/netboot/fxp.c:1.10 Mon Jan 12 09:41:59 2009
+++ src/sys/arch/sandpoint/stand/netboot/fxp.c Sun May 2 13:36:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: fxp.c,v 1.10 2009/01/12 09:41:59 tsutsui Exp $ */
+/* $NetBSD: fxp.c,v 1.11 2010/05/02 13:36:30 phx Exp $ */
/*
* most of the following code was imported from dev/ic/i82557.c; the
@@ -97,7 +97,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct txdesc {
volatile uint16_t cb_status;
Index: src/sys/arch/sandpoint/stand/netboot/wm.c
diff -u src/sys/arch/sandpoint/stand/netboot/wm.c:1.10 src/sys/arch/sandpoint/stand/netboot/wm.c:1.11
--- src/sys/arch/sandpoint/stand/netboot/wm.c:1.10 Sun Jan 25 03:39:28 2009
+++ src/sys/arch/sandpoint/stand/netboot/wm.c Sun May 2 13:36:31 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wm.c,v 1.10 2009/01/25 03:39:28 nisimura Exp $ */
+/* $NetBSD: wm.c,v 1.11 2010/05/02 13:36:31 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct tdesc {
uint32_t lo; /* 31:0 */
Index: src/sys/arch/sandpoint/stand/netboot/kse.c
diff -u src/sys/arch/sandpoint/stand/netboot/kse.c:1.3 src/sys/arch/sandpoint/stand/netboot/kse.c:1.4
--- src/sys/arch/sandpoint/stand/netboot/kse.c:1.3 Sun Jan 25 03:39:28 2009
+++ src/sys/arch/sandpoint/stand/netboot/kse.c Sun May 2 13:36:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: kse.c,v 1.3 2009/01/25 03:39:28 nisimura Exp $ */
+/* $NetBSD: kse.c,v 1.4 2010/05/02 13:36:30 phx Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct desc {
uint32_t xd0, xd1, xd2, xd3;
Index: src/sys/arch/sandpoint/stand/netboot/nvt.c
diff -u src/sys/arch/sandpoint/stand/netboot/nvt.c:1.17 src/sys/arch/sandpoint/stand/netboot/nvt.c:1.18
--- src/sys/arch/sandpoint/stand/netboot/nvt.c:1.17 Sun Jan 25 03:39:28 2009
+++ src/sys/arch/sandpoint/stand/netboot/nvt.c Sun May 2 13:36:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: nvt.c,v 1.17 2009/01/25 03:39:28 nisimura Exp $ */
+/* $NetBSD: nvt.c,v 1.18 2010/05/02 13:36:30 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct desc {
uint32_t xd0, xd1, xd2, xd3;
Index: src/sys/arch/sandpoint/stand/netboot/vge.c
diff -u src/sys/arch/sandpoint/stand/netboot/vge.c:1.17 src/sys/arch/sandpoint/stand/netboot/vge.c:1.18
--- src/sys/arch/sandpoint/stand/netboot/vge.c:1.17 Mon Jan 12 09:41:59 2009
+++ src/sys/arch/sandpoint/stand/netboot/vge.c Sun May 2 13:36:31 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vge.c,v 1.17 2009/01/12 09:41:59 tsutsui Exp $ */
+/* $NetBSD: vge.c,v 1.18 2010/05/02 13:36:31 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct tdesc {
uint32_t t0, t1;
Index: src/sys/arch/sandpoint/stand/netboot/pcn.c
diff -u src/sys/arch/sandpoint/stand/netboot/pcn.c:1.16 src/sys/arch/sandpoint/stand/netboot/pcn.c:1.17
--- src/sys/arch/sandpoint/stand/netboot/pcn.c:1.16 Sun Jan 25 03:39:28 2009
+++ src/sys/arch/sandpoint/stand/netboot/pcn.c Sun May 2 13:36:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pcn.c,v 1.16 2009/01/25 03:39:28 nisimura Exp $ */
+/* $NetBSD: pcn.c,v 1.17 2010/05/02 13:36:30 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct desc {
uint32_t xd0, xd1, xd2;
Index: src/sys/arch/sandpoint/stand/netboot/rge.c
diff -u src/sys/arch/sandpoint/stand/netboot/rge.c:1.16 src/sys/arch/sandpoint/stand/netboot/rge.c:1.17
--- src/sys/arch/sandpoint/stand/netboot/rge.c:1.16 Mon Jul 20 11:43:09 2009
+++ src/sys/arch/sandpoint/stand/netboot/rge.c Sun May 2 13:36:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: rge.c,v 1.16 2009/07/20 11:43:09 nisimura Exp $ */
+/* $NetBSD: rge.c,v 1.17 2010/05/02 13:36:30 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct desc {
uint32_t xd0, xd1, xd2, xd3;
Index: src/sys/arch/sandpoint/stand/netboot/sip.c
diff -u src/sys/arch/sandpoint/stand/netboot/sip.c:1.16 src/sys/arch/sandpoint/stand/netboot/sip.c:1.17
--- src/sys/arch/sandpoint/stand/netboot/sip.c:1.16 Mon Jan 12 09:41:59 2009
+++ src/sys/arch/sandpoint/stand/netboot/sip.c Sun May 2 13:36:31 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sip.c,v 1.16 2009/01/12 09:41:59 tsutsui Exp $ */
+/* $NetBSD: sip.c,v 1.17 2010/05/02 13:36:31 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct desc {
uint32_t xd0, xd1, xd2;
Index: src/sys/arch/sandpoint/stand/netboot/sme.c
diff -u src/sys/arch/sandpoint/stand/netboot/sme.c:1.2 src/sys/arch/sandpoint/stand/netboot/sme.c:1.3
--- src/sys/arch/sandpoint/stand/netboot/sme.c:1.2 Mon Jan 12 09:41:59 2009
+++ src/sys/arch/sandpoint/stand/netboot/sme.c Sun May 2 13:36:31 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sme.c,v 1.2 2009/01/12 09:41:59 tsutsui Exp $ */
+/* $NetBSD: sme.c,v 1.3 2010/05/02 13:36:31 phx Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct desc {
uint32_t xd0, xd1, xd2, xd3;
Index: src/sys/arch/sandpoint/stand/netboot/tlp.c
diff -u src/sys/arch/sandpoint/stand/netboot/tlp.c:1.24 src/sys/arch/sandpoint/stand/netboot/tlp.c:1.25
--- src/sys/arch/sandpoint/stand/netboot/tlp.c:1.24 Thu Jul 9 15:39:28 2009
+++ src/sys/arch/sandpoint/stand/netboot/tlp.c Sun May 2 13:36:31 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: tlp.c,v 1.24 2009/07/09 15:39:28 nisimura Exp $ */
+/* $NetBSD: tlp.c,v 1.25 2010/05/02 13:36:31 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
#define wbinv(adr, siz) _wbinv(VTOPHYS(adr), (uint32_t)(siz))
#define inv(adr, siz) _inv(VTOPHYS(adr), (uint32_t)(siz))
#define DELAY(n) delay(n)
-#define ALLOC(T,A) (T *)((unsigned)alloc(sizeof(T) + (A)) &~ ((A) - 1))
+#define ALLOC(T,A) (T *)allocaligned(sizeof(T),(A))
struct desc {
uint32_t xd0, xd1, xd2, xd3;