Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/pcpu.h
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | |||||
#define PC_DBREG_CMD_NONE 0 | #define PC_DBREG_CMD_NONE 0 | ||||
#define PC_DBREG_CMD_LOAD 1 | #define PC_DBREG_CMD_LOAD 1 | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#define MONITOR_STOPSTATE_RUNNING 0 | #define MONITOR_STOPSTATE_RUNNING 0 | ||||
#define MONITOR_STOPSTATE_STOPPED 1 | #define MONITOR_STOPSTATE_STOPPED 1 | ||||
#if defined(__GNUCLIKE___TYPEOF) | |||||
/* | /* | ||||
* Evaluates to the byte offset of the per-cpu variable name. | * Evaluates to the byte offset of the per-cpu variable name. | ||||
*/ | */ | ||||
#define __pcpu_offset(name) \ | #define __pcpu_offset(name) \ | ||||
__offsetof(struct pcpu, name) | __offsetof(struct pcpu, name) | ||||
/* | /* | ||||
* Evaluates to the type of the per-cpu variable name. | * Evaluates to the type of the per-cpu variable name. | ||||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | __asm __volatile("subl\t%1,%%gs:(%0)" \ | ||||
: : "r" (base), "ri" (__n) : "memory", "cc"); \ | : : "r" (base), "ri" (__n) : "memory", "cc"); \ | ||||
break; \ | break; \ | ||||
case 8: \ | case 8: \ | ||||
__asm __volatile("subq\t%1,%%gs:(%0)" \ | __asm __volatile("subq\t%1,%%gs:(%0)" \ | ||||
: : "r" (base), "ri" (__n) : "memory", "cc"); \ | : : "r" (base), "ri" (__n) : "memory", "cc"); \ | ||||
break; \ | break; \ | ||||
} \ | } \ | ||||
} while (0); | } while (0); | ||||
#else /* !__GNUCLIKE___TYPEOF */ | |||||
#error "this file needs to be ported to your compiler" | |||||
#endif /* __GNUCLIKE___TYPEOF */ | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* !_MACHINE_PCPU_H_ */ | #endif /* !_MACHINE_PCPU_H_ */ |