#include <arm/param.h>
arm/param.h
Machine dependent constants for ARM
macroALIGNBYTES
Round p (pointer or byte index) up to a correctly-aligned value for all
data types (int, long, ...). The result is unsigned int and must be
cast to any desired pointer type.
#define ALIGNBYTES __DARWIN_ALIGNBYTES
macroALIGN
#define ALIGN(p) __DARWIN_ALIGN(p)
macroDEV_BSIZE
#define DEV_BSIZE 512
macroBLKDEV_IOSIZE
#define BLKDEV_IOSIZE 2048
macroCLSIZE
#define CLSIZE 1
macroCLSIZELOG2
#define CLSIZELOG2 0
macroMSIZESHIFT
Constants related to network buffer management.
MCLBYTES must be no larger than CLBYTES (the software page size), and,
on machines that exchange pages of input or output buffers with mbuf
clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
of the hardware page size.
#define MSIZESHIFT 8
256
macroctos
Some macros for units conversion
Core clicks (NeXT_page_size bytes) to segments and vice versa
#define ctos(x) (x)
macrostoc
#define stoc(x) (x)
macrodtoc
#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
macrodtob
#define dtob(x) ((x)<<DEV_BSHIFT)
macrobtodb
#define btodb(bytes, devBlockSize) ((unsigned)(bytes) / devBlockSize)
macrodbtob
#define dbtob(db, devBlockSize) ((unsigned)(db) * devBlockSize)
macrobdbtofsb
Map a ``block device block'' to a file system block.
This should be device dependent, and will be if we
add an entry to cdevsw/bdevsw for that purpose.
For now though just use DEV_BSIZE.
#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
macroSTATUS_WORD
Macros to decode (and encode) processor status word.
#define STATUS_WORD(rpl, ipl) (((ipl) << 8) | (rpl))
macroUSERMODE
#define USERMODE(x) (((x) & 3) == 3)
macroBASEPRI
#define BASEPRI(x) (((x) & (255 << 8)) == 0)
macroDELAY
#define DELAY(n) delay(n)