diff options
author | dfr <dfr@FreeBSD.org> | 2000-12-30 13:06:01 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2000-12-30 13:06:01 +0000 |
commit | 78040d3f1936ce8d42f49b652f71cf6c42aa8e23 (patch) | |
tree | 56c4ac1d21bd824bcf784379ca04457a008cc033 /sys/ia64 | |
parent | 83798d65dc222a19d8b01d4ee96b16f2fe2b8832 (diff) | |
download | FreeBSD-src-78040d3f1936ce8d42f49b652f71cf6c42aa8e23.zip FreeBSD-src-78040d3f1936ce8d42f49b652f71cf6c42aa8e23.tar.gz |
Merge ALIGN changes from alpha code.
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/include/param.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/sys/ia64/include/param.h b/sys/ia64/include/param.h index f061848..db2271f 100644 --- a/sys/ia64/include/param.h +++ b/sys/ia64/include/param.h @@ -46,6 +46,27 @@ /* * Machine dependent constants for the IA64. */ +/* + * Round p (pointer or byte index) up to a correctly-aligned value for all + * data types (int, long, ...). The result is u_long and must be cast to + * any desired pointer type. + * + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + * + */ +#ifndef _ALIGNBYTES +#define _ALIGNBYTES 7 +#endif +#ifndef _ALIGN +#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) +#endif +#ifndef _ALIGNED_POINTER +#define _ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) +#endif + #ifndef _MACHINE #define _MACHINE ia64 #endif @@ -83,9 +104,9 @@ * (within reasonable limits). * */ -#define ALIGNBYTES 7 -#define ALIGN(p) (((u_long)(p) + ALIGNBYTES) &~ ALIGNBYTES) -#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) +#define ALIGNBYTES _ALIGNBYTES +#define ALIGN(p) _ALIGN(p) +#define ALIGNED_POINTER(p,t) _ALIGNED_POINTER(p,t) #define PAGE_SIZE 4096 /* bytes/page */ #define PAGE_SHIFT 12 |