version 1.129.2.5, 2007/01/27 07:09:02 |
version 1.130, 2006/12/08 15:05:18 |
|
|
struct cpu_info { |
struct cpu_info { |
struct device *ci_dev; /* pointer to our device */ |
struct device *ci_dev; /* pointer to our device */ |
struct cpu_info *ci_self; /* self-pointer */ |
struct cpu_info *ci_self; /* self-pointer */ |
void *ci_self150; /* self + 0x150, see lock_stubs.S */ |
|
void *ci_tlog_base; /* Trap log base */ |
void *ci_tlog_base; /* Trap log base */ |
int32_t ci_tlog_offset; /* Trap log current offset */ |
int32_t ci_tlog_offset; /* Trap log current offset */ |
struct cpu_info *ci_next; /* next cpu */ |
struct cpu_info *ci_next; /* next cpu */ |
Line 107 struct cpu_info { |
|
Line 106 struct cpu_info { |
|
int ci_idle_tss_sel; /* TSS selector of idle PCB */ |
int ci_idle_tss_sel; /* TSS selector of idle PCB */ |
|
|
struct intrsource *ci_isources[MAX_INTR_SOURCES]; |
struct intrsource *ci_isources[MAX_INTR_SOURCES]; |
volatile int ci_mtx_count; /* Negative count of spin mutexes */ |
uint32_t ci_ipending; |
volatile int ci_mtx_oldspl; /* Old SPL at this ci_idepth */ |
int ci_ilevel; |
|
|
/* The following must be aligned for cmpxchg8b. */ |
|
struct { |
|
uint32_t ipending; |
|
int ilevel; |
|
} ci_istate __aligned(8); |
|
#define ci_ipending ci_istate.ipending |
|
#define ci_ilevel ci_istate.ilevel |
|
|
|
int ci_idepth; |
int ci_idepth; |
uint32_t ci_imask[NIPL]; |
uint32_t ci_imask[NIPL]; |
uint32_t ci_iunmask[NIPL]; |
uint32_t ci_iunmask[NIPL]; |
|
|
|
|
#define CPU_IS_PRIMARY(ci) ((ci)->ci_flags & CPUF_PRIMARY) |
#define CPU_IS_PRIMARY(ci) ((ci)->ci_flags & CPUF_PRIMARY) |
|
|
#define aston(l) ((l)->l_md.md_astpending = 1) |
#define aston(p) ((p)->p_md.md_astpending = 1) |
|
|
extern struct cpu_info *cpu_info[X86_MAXPROCS]; |
extern struct cpu_info *cpu_info[X86_MAXPROCS]; |
|
|
void cpu_boot_secondary_processors(void); |
void cpu_boot_secondary_processors(void); |
void cpu_init_idle_pcbs(void); |
void cpu_init_idle_pcbs(void); |
|
|
|
/* |
|
* Preempt the current process if in interrupt from user mode, |
|
* or after the current trap/syscall if in system mode. |
|
*/ |
|
extern void need_resched(struct cpu_info *); |
|
|
#else /* !MULTIPROCESSOR */ |
#else /* !MULTIPROCESSOR */ |
|
|
#define X86_MAXPROCS 1 |
#define X86_MAXPROCS 1 |
Line 239 void cpu_init_idle_pcbs(void); |
|
Line 235 void cpu_init_idle_pcbs(void); |
|
#define cpu_number() 0 |
#define cpu_number() 0 |
#define CPU_IS_PRIMARY(ci) 1 |
#define CPU_IS_PRIMARY(ci) 1 |
|
|
#define aston(l) ((l)->l_md.md_astpending = 1) |
|
|
|
#endif /* MULTIPROCESSOR */ |
|
|
|
/* |
/* |
* Preempt the current process if in interrupt from user mode, |
* Preempt the current process if in interrupt from user mode, |
* or after the current trap/syscall if in system mode. |
* or after the current trap/syscall if in system mode. |
*/ |
*/ |
extern void cpu_need_resched(struct cpu_info *); |
#define need_resched(ci) \ |
|
do { \ |
|
struct cpu_info *__ci = (ci); \ |
|
__ci->ci_want_resched = 1; \ |
|
if (__ci->ci_curlwp != NULL) \ |
|
aston(__ci->ci_curlwp->l_proc); \ |
|
} while (/*CONSTCOND*/0) |
|
|
|
#define aston(p) ((p)->p_md.md_astpending = 1) |
|
|
|
#endif /* MULTIPROCESSOR */ |
|
|
extern uint32_t cpus_attached; |
extern uint32_t cpus_attached; |
|
|
Line 283 struct clockframe { |
|
Line 285 struct clockframe { |
|
* buffer pages are invalid. On the i386, request an ast to send us |
* buffer pages are invalid. On the i386, request an ast to send us |
* through trap(), marking the proc as needing a profiling tick. |
* through trap(), marking the proc as needing a profiling tick. |
*/ |
*/ |
extern void cpu_need_proftick(struct lwp *l); |
#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, aston(p)) |
|
|
/* |
/* |
* Notify the LWP l that it has a signal pending, process as soon as |
* Notify the current process (p) that it has a signal pending, |
* possible. |
* process as soon as possible. |
*/ |
*/ |
extern void cpu_signotify(struct lwp *); |
#define signotify(p) aston(p) |
|
|
/* |
/* |
* We need a machine-independent name for this. |
* We need a machine-independent name for this. |