Fixed ALLOC() macro to allocate properly aligned memory.

This commit is contained in:
phx 2010-05-02 13:36:30 +00:00
parent cea3999396
commit f6b5358cf9
10 changed files with 20 additions and 20 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 */