Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/pcpu.h
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | |||||
#define curcpu PCPU_GET(cpuid) | #define curcpu PCPU_GET(cpuid) | ||||
#define curproc (curthread->td_proc) | #define curproc (curthread->td_proc) | ||||
#ifndef curthread | #ifndef curthread | ||||
#define curthread PCPU_GET(curthread) | #define curthread PCPU_GET(curthread) | ||||
#endif | #endif | ||||
#define curvidata PCPU_GET(vidata) | #define curvidata PCPU_GET(vidata) | ||||
#define UMA_PCPU_ALLOC_SIZE PAGE_SIZE | |||||
/* Accessor to elements allocated via UMA_ZONE_PCPU zone. */ | /* Accessor to elements allocated via UMA_ZONE_PCPU zone. */ | ||||
static inline void * | static inline void * | ||||
zpcpu_get(void *base) | zpcpu_get(void *base) | ||||
{ | { | ||||
return ((char *)(base) + sizeof(struct pcpu) * curcpu); | return ((char *)(base) + UMA_PCPU_ALLOC_SIZE * curcpu); | ||||
} | } | ||||
static inline void * | static inline void * | ||||
zpcpu_get_cpu(void *base, int cpu) | zpcpu_get_cpu(void *base, int cpu) | ||||
{ | { | ||||
return ((char *)(base) + sizeof(struct pcpu) * cpu); | return ((char *)(base) + UMA_PCPU_ALLOC_SIZE * cpu); | ||||
} | } | ||||
/* | /* | ||||
* Machine dependent callouts. cpu_pcpu_init() is responsible for | * Machine dependent callouts. cpu_pcpu_init() is responsible for | ||||
* initializing machine dependent fields of struct pcpu, and | * initializing machine dependent fields of struct pcpu, and | ||||
* db_show_mdpcpu() is responsible for handling machine dependent | * db_show_mdpcpu() is responsible for handling machine dependent | ||||
* fields for the DDB 'show pcpu' command. | * fields for the DDB 'show pcpu' command. | ||||
*/ | */ | ||||
Show All 14 Lines |