00001 #ifndef cpudef_h 00002 #define cpudef_h 00003 00004 #define CPU_C_MAX_CPUS 32 00005 #define CPU_C_RESERVED 0 00006 #define CPU_C_INIT 1 00007 #define CPU_C_RUN 2 00008 #define CPU_C_STOPPING 3 00009 #define CPU_C_STOPPED 4 00010 #define CPU_C_TIMOUT 5 00011 #define CPU_C_BOOT_REJECTED 6 00012 #define CPU_C_BOOTED 7 00013 #define CPU_C_NOT_CONFIGURED 8 00014 #define CPU_C_POWERED_DOWN 9 00015 #define CPU_M_INV_TBS 0x1 00016 #define CPU_M_INV_TBA 0x2 00017 #define CPU_M_BUGCHK 0x4 00018 #define CPU_M_BUGCHKACK 0x8 00019 #define CPU_M_RECALSCHD 0x10 00020 #define CPU_M_UPDASTSR 0x20 00021 #define CPU_M_UPDATE_HWCLOCK 0x40 00022 #define CPU_M_WORK_FQP 0x80 00023 #define CPU_M_QLOST 0x100 00024 #define CPU_M_RESCHED 0x200 00025 #define CPU_M_VIRTCONS 0x400 00026 #define CPU_M_IOPOST 0x800 00027 #define CPU_M_INV_ISTREAM 0x1000 00028 #define CPU_M_INV_TBSD 0x2000 00029 #define CPU_M_INV_TBS_MMG 0x4000 00030 #define CPU_M_INV_TBSD_MMG 0x8000 00031 #define CPU_M_IO_INT_AFF 0x10000 00032 #define CPU_M_IO_START_AFF 0x20000 00033 #define CPU_M_CPUFILL_1 0xFFFFFFF 00034 #define CPU_M_CPUSPEC1 0x10000000 00035 #define CPU_M_CPUSPEC2 0x20000000 00036 #define CPU_M_CPUSPEC3 0x40000000 00037 #define CPU_M_CPUSPEC4 0x80000000 00038 #define CPU_K_NUM_SWIQS 6 00039 #define CPU_M_SYS_ASTEN 0xF 00040 #define CPU_M_SYS_ASTSR 0xF0 00041 #define CPU_M_SYS_FEN 0x1 00042 #define CPU_M_SYS_PME 0x4000000000000000 00043 #define CPU_M_SYS_DATFX 0x8000000000000000 00044 #define CPU_M_TERM_ASTEN 0xF 00045 #define CPU_M_TERM_ASTSR 0xF0 00046 #define CPU_M_TERM_FEN 0x1 00047 #define CPU_M_TERM_PME 0x4000000000000000 00048 #define CPU_M_TERM_DATFX 0x8000000000000000 00049 #define CPU_M_SCHED 0x1 00050 #define CPU_M_FOREVER 0x2 00051 #define CPU_M_NEWPRIM 0x4 00052 #define CPU_M_PSWITCH 0x8 00053 #define CPU_M_BC_STACK 0x10 00054 #define CPU_M_BC_CONTEXT 0x20 00055 #define CPU_M_USER_CAPABILITIES_SET 0x40 00056 #define CPU_M_STOPPING 0x1 00057 #define CPU_M_PCSAMPLE_ACTIVE 0x1 00058 #define CPU_M_IO_AFF_FKB_INUSE 0x1 00059 #define CPU_M_PORT_ASSIGNED 0x2 00060 #define CPU_M_DISTRIBUTED_INTS 0x4 00061 #define CPU_M_LASTPAGE_TESTED 0x20000000 00062 #define CPU_M_MCHECK 0x40000000 00063 #define CPU_M_MEMORY_WRITE 0x80000000 00064 #define CPU_M_AUTO_START 0x1 00065 #define CPU_M_NOBINDINGS 0x2 00066 00067 #define CPU_K_SCHED_LENGTH 40 00068 00069 #define CPU_K_LENGTH 2528 00070 #define CPU_C_LENGTH 2528 00071 #define CPU_M_AGE_DATA 0x1 00072 00073 #ifndef _pcb 00074 #define _pcb task_struct 00075 struct task_struct; 00076 #endif 00077 00078 struct _cpu { 00079 struct _pcb *cpu_l_curpcb; 00080 // struct _ktb *cpu_l_curktb; 00081 unsigned char cpu_b_ipl; /* some cpus lack something. what is the connnection to PSL IPL? */ 00082 unsigned short cpu_w_sisr; /* some cpus lacks... pending interrupts */ 00083 unsigned char iplnr; 00084 unsigned char previpl[32]; 00085 struct { 00086 unsigned char interrupt; 00087 unsigned char at_level; 00088 void * address; 00089 } cpu_t_ipending[256]; 00090 00091 // unsigned char cpu_b_astlvl; /* some cpus lack something. pcb stuff. */ 00092 unsigned char cpu_b_intstk; /* PSL IS. not yet used */ 00093 unsigned char cpu_b_cur_mod; /* PSL CUR_MOD */ 00094 unsigned char cpu_b_prv_mod; /* PSL PRV_MOD */ 00095 00096 unsigned long cpu_l_realstack; 00097 unsigned short int cpu_w_size; 00098 unsigned char cpu_b_type; 00099 unsigned char cpu_b_subtype; 00100 unsigned char cpu_b_busywait; 00101 unsigned char cpu_b_state; 00102 unsigned char cpu_b_cpumtx; 00103 unsigned char cpu_b_cur_pri; 00104 unsigned long cpu_l_work_req; 00105 unsigned long cpu_l_percpuva; 00106 unsigned long cpu_l_saved_ap; 00107 unsigned long cpu_l_haltpc; 00108 unsigned long cpu_l_haltpsl; 00109 unsigned long cpu_l_saved_isp; 00110 unsigned long cpu_l_pcbb; 00111 unsigned long cpu_l_scbb; 00112 unsigned long cpu_l_sisr; 00113 unsigned long cpu_l_p0br; 00114 unsigned long cpu_l_p0lr; 00115 unsigned long cpu_l_p1br; 00116 unsigned long cpu_l_p1lr; 00117 unsigned long cpu_l_bugcode; 00118 unsigned long cpu_l_mchk_mask; 00119 unsigned long cpu_l_mchk_sp; 00120 unsigned long cpu_l_p0pt_page; 00121 unsigned long long cpu_q_swiqfl [6]; 00122 unsigned long cpu_l_psfl; 00123 unsigned long cpu_l_psbl; 00124 unsigned long cpu_l_boot_time; 00125 unsigned long cpu_l_cpuid_mask; 00126 unsigned long cpu_l_phy_cpuid; 00127 unsigned long cpu_l_capability; 00128 unsigned long cpu_l_tenusec; 00129 unsigned long cpu_l_ubdelay; 00130 unsigned long cpu_l_nullcpu; 00131 long cpu_ps_pda; 00132 }; 00133 00134 struct _sched_ds { 00135 unsigned long long cpu_q_acc_run; 00136 unsigned long long cpu_q_proc_count; 00137 unsigned long long cpu_q_acc_interrupt; 00138 unsigned long long cpu_q_acc_waitime; 00139 unsigned long long cpu_q_sched_flags; 00140 }; 00141 00142 #endif 00143 00144