[BACK]Return to cpu.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / i386 / include

Annotation of src/sys/arch/i386/include/cpu.h, Revision 1.136

1.136   ! ad          1: /*     $NetBSD: cpu.h,v 1.135 2007/03/05 16:51:02 drochner Exp $       */
1.24      cgd         2:
1.1       cgd         3: /*-
                      4:  * Copyright (c) 1990 The Regents of the University of California.
                      5:  * All rights reserved.
                      6:  *
                      7:  * This code is derived from software contributed to Berkeley by
                      8:  * William Jolitz.
                      9:  *
                     10:  * Redistribution and use in source and binary forms, with or without
                     11:  * modification, are permitted provided that the following conditions
                     12:  * are met:
                     13:  * 1. Redistributions of source code must retain the above copyright
                     14:  *    notice, this list of conditions and the following disclaimer.
                     15:  * 2. Redistributions in binary form must reproduce the above copyright
                     16:  *    notice, this list of conditions and the following disclaimer in the
                     17:  *    documentation and/or other materials provided with the distribution.
1.103     agc        18:  * 3. Neither the name of the University nor the names of its contributors
1.1       cgd        19:  *    may be used to endorse or promote products derived from this software
                     20:  *    without specific prior written permission.
                     21:  *
                     22:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     23:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     24:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     25:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     26:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     27:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     28:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     29:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     30:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     31:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     32:  * SUCH DAMAGE.
                     33:  *
1.24      cgd        34:  *     @(#)cpu.h       5.4 (Berkeley) 5/9/91
1.1       cgd        35:  */
                     36:
1.14      mycroft    37: #ifndef _I386_CPU_H_
                     38: #define _I386_CPU_H_
                     39:
1.108     simonb     40: #ifdef _KERNEL
1.71      mrg        41: #if defined(_KERNEL_OPT)
1.129     xtraeme    42: #include "opt_enhanced_speedstep.h"
1.63      thorpej    43: #include "opt_multiprocessor.h"
1.108     simonb     44: #include "opt_math_emulate.h"
                     45: #include "opt_user_ldt.h"
                     46: #include "opt_vm86.h"
1.63      thorpej    47: #endif
                     48:
1.1       cgd        49: /*
                     50:  * Definitions unique to i386 cpu support.
                     51:  */
1.12      mycroft    52: #include <machine/frame.h>
                     53: #include <machine/segments.h>
1.83      fvdl       54: #include <machine/tss.h>
1.89      fvdl       55: #include <machine/intrdefs.h>
1.100     fvdl       56: #include <x86/cacheinfo.h>
1.133     daniel     57: #include <x86/via_padlock.h>
1.63      thorpej    58:
1.82      fvdl       59: #include <sys/device.h>
1.136   ! ad         60: #include <sys/simplelock.h>                    /* will also get LOCKDEBUG */
1.116     yamt       61: #include <sys/cpu_data.h>
                     62: #include <sys/cc_microtime.h>
1.70      thorpej    63:
1.105     yamt       64: #include <lib/libkern/libkern.h>       /* offsetof */
                     65:
1.89      fvdl       66: struct intrsource;
1.113     yamt       67: struct pmap;
1.85      fvdl       68:
1.82      fvdl       69: /*
                     70:  * a bunch of this belongs in cpuvar.h; move it later..
                     71:  */
                     72:
1.63      thorpej    73: struct cpu_info {
1.82      fvdl       74:        struct device *ci_dev;          /* pointer to our device */
                     75:        struct cpu_info *ci_self;       /* self-pointer */
1.131     ad         76:        void    *ci_self150;            /* self + 0x150, see lock_stubs.S */
1.82      fvdl       77:        void    *ci_tlog_base;          /* Trap log base */
                     78:        int32_t ci_tlog_offset;         /* Trap log current offset */
                     79:        struct cpu_info *ci_next;       /* next cpu */
                     80:
                     81:        /*
                     82:         * Public members.
                     83:         */
1.95      thorpej    84:        struct lwp *ci_curlwp;          /* current owner of the processor */
1.82      fvdl       85:        struct simplelock ci_slock;     /* lock on this data structure */
                     86:        cpuid_t ci_cpuid;               /* our CPU ID */
1.90      fvdl       87:        u_int ci_apicid;                /* our APIC ID */
1.116     yamt       88:        struct cpu_data ci_data;        /* MI per-cpu data */
                     89:        struct cc_microtime_state ci_cc;/* cc_microtime state */
1.82      fvdl       90:
                     91:        /*
                     92:         * Private members.
                     93:         */
1.95      thorpej    94:        struct lwp *ci_fpcurlwp;        /* current owner of the FPU */
1.82      fvdl       95:        int     ci_fpsaving;            /* save in progress */
                     96:
1.120     perry      97:        volatile uint32_t       ci_tlb_ipi_mask;
1.89      fvdl       98:
1.113     yamt       99:        struct pmap *ci_pmap;           /* current pmap */
                    100:        int ci_want_pmapload;           /* pmap_load() is needed */
                    101:        int ci_tlbstate;                /* one of TLBSTATE_ states. see below */
                    102: #define        TLBSTATE_VALID  0       /* all user tlbs are valid */
                    103: #define        TLBSTATE_LAZY   1       /* tlbs are valid but won't be kept uptodate */
                    104: #define        TLBSTATE_STALE  2       /* we might have stale user tlbs */
                    105:
1.82      fvdl      106:        struct pcb *ci_curpcb;          /* VA of current HW PCB */
                    107:        struct pcb *ci_idle_pcb;        /* VA of current PCB */
                    108:        int ci_idle_tss_sel;            /* TSS selector of idle PCB */
                    109:
1.89      fvdl      110:        struct intrsource *ci_isources[MAX_INTR_SOURCES];
1.131     ad        111:        volatile int    ci_mtx_count;   /* Negative count of spin mutexes */
                    112:        volatile int    ci_mtx_oldspl;  /* Old SPL at this ci_idepth */
                    113:
                    114:        /* The following must be aligned for cmpxchg8b. */
                    115:        struct {
                    116:                uint32_t        ipending;
                    117:                int             ilevel;
                    118:        } ci_istate __aligned(8);
                    119: #define ci_ipending    ci_istate.ipending
                    120: #define        ci_ilevel       ci_istate.ilevel
                    121:
1.89      fvdl      122:        int             ci_idepth;
1.120     perry     123:        uint32_t        ci_imask[NIPL];
                    124:        uint32_t        ci_iunmask[NIPL];
1.130     yamt      125:        void *          ci_intrstack;
1.89      fvdl      126:
1.82      fvdl      127:        paddr_t ci_idle_pcb_paddr;      /* PA of idle PCB */
1.120     perry     128:        uint32_t ci_flags;              /* flags; see below */
                    129:        uint32_t ci_ipis;               /* interprocessor interrupts pending */
1.82      fvdl      130:        int sc_apic_version;            /* local APIC version */
                    131:
                    132:        int32_t         ci_cpuid_level;
1.120     perry     133:        uint32_t        ci_signature;    /* X86 cpuid type */
                    134:        uint32_t        ci_feature_flags;/* X86 %edx CPUID feature bits */
                    135:        uint32_t        ci_feature2_flags;/* X86 %ecx CPUID feature bits */
                    136:        uint32_t        ci_feature3_flags;/* X86 extended feature bits */
1.133     daniel    137:        uint32_t        ci_padlock_flags;/* VIA PadLock feature bits */
1.120     perry     138:        uint32_t        ci_cpu_class;    /* CPU class */
                    139:        uint32_t        ci_brand_id;     /* Intel brand id */
                    140:        uint32_t        ci_vendor[4];    /* vendor string */
                    141:        uint32_t        ci_cpu_serial[3]; /* PIII serial number */
                    142:        uint64_t        ci_tsc_freq;     /* cpu cycles/second */
1.82      fvdl      143:
1.135     drochner  144:        const struct cpu_functions *ci_func;  /* start/stop functions */
1.109     junyoung  145:        void (*cpu_setup)(struct cpu_info *);
1.82      fvdl      146:                                        /* proc-dependant init */
1.109     junyoung  147:        void (*ci_info)(struct cpu_info *);
1.82      fvdl      148:
                    149:        int             ci_want_resched;
                    150:        int             ci_astpending;
                    151:        struct trapframe *ci_ddb_regs;
1.69      thorpej   152:
1.73      thorpej   153:        u_int ci_cflush_lsize;  /* CFLUSH insn line size */
1.100     fvdl      154:        struct x86_cache_info ci_cinfo[CAI_COUNT];
1.82      fvdl      155:
                    156:        union descriptor *ci_gdt;
1.83      fvdl      157:
                    158:        struct i386tss  ci_doubleflt_tss;
                    159:        struct i386tss  ci_ddbipi_tss;
                    160:
                    161:        char *ci_doubleflt_stack;
                    162:        char *ci_ddbipi_stack;
1.89      fvdl      163:
1.97      fvdl      164:        struct evcnt ci_ipi_events[X86_NIPI];
1.133     daniel    165:
                    166:        struct via_padlock      ci_vp;  /* VIA PadLock private storage */
1.63      thorpej   167: };
                    168:
1.82      fvdl      169: /*
                    170:  * Processor flag notes: The "primary" CPU has certain MI-defined
                    171:  * roles (mostly relating to hardclock handling); we distinguish
                    172:  * betwen the processor which booted us, and the processor currently
                    173:  * holding the "primary" role just to give us the flexibility later to
                    174:  * change primaries should we be sufficiently twisted.
                    175:  */
                    176:
                    177: #define        CPUF_BSP        0x0001          /* CPU is the original BSP */
                    178: #define        CPUF_AP         0x0002          /* CPU is an AP */
                    179: #define        CPUF_SP         0x0004          /* CPU is only processor */
                    180: #define        CPUF_PRIMARY    0x0008          /* CPU is active primary processor */
                    181:
                    182: #define CPUF_APIC_CD    0x0010         /* CPU has apic configured */
                    183:
                    184: #define        CPUF_PRESENT    0x1000          /* CPU is present */
                    185: #define        CPUF_RUNNING    0x2000          /* CPU is running */
                    186: #define        CPUF_PAUSE      0x4000          /* CPU is paused in DDB */
                    187: #define        CPUF_GO         0x8000          /* CPU should start running */
                    188:
                    189: /*
                    190:  * We statically allocate the CPU info for the primary CPU (or,
                    191:  * the only CPU on uniprocessors), and the primary CPU is the
                    192:  * first CPU on the CPU info list.
                    193:  */
                    194: extern struct cpu_info cpu_info_primary;
                    195: extern struct cpu_info *cpu_info_list;
                    196:
                    197: #define        CPU_INFO_ITERATOR               int
                    198: #define        CPU_INFO_FOREACH(cii, ci)       cii = 0, ci = cpu_info_list; \
                    199:                                        ci != NULL; ci = ci->ci_next
                    200:
                    201: #if defined(MULTIPROCESSOR)
                    202:
1.97      fvdl      203: #define X86_MAXPROCS           32      /* because we use a bitmask */
1.82      fvdl      204:
                    205: #define CPU_STARTUP(_ci)       ((_ci)->ci_func->start(_ci))
                    206: #define CPU_STOP(_ci)          ((_ci)->ci_func->stop(_ci))
                    207: #define CPU_START_CLEANUP(_ci) ((_ci)->ci_func->cleanup(_ci))
                    208:
1.105     yamt      209: static struct cpu_info *curcpu(void);
                    210:
1.123     perry     211: __inline static struct cpu_info * __attribute__((__unused__))
1.105     yamt      212: curcpu()
                    213: {
                    214:        struct cpu_info *ci;
                    215:
1.119     perry     216:        __asm volatile("movl %%fs:%1, %0" :
1.105     yamt      217:            "=r" (ci) :
                    218:            "m"
1.115     yamt      219:            (*(struct cpu_info * const *)offsetof(struct cpu_info, ci_self)));
1.105     yamt      220:        return ci;
                    221: }
                    222:
1.82      fvdl      223: #define cpu_number()           (curcpu()->ci_cpuid)
                    224:
                    225: #define CPU_IS_PRIMARY(ci)     ((ci)->ci_flags & CPUF_PRIMARY)
                    226:
1.131     ad        227: #define aston(l)               ((l)->l_md.md_astpending = 1)
1.82      fvdl      228:
1.97      fvdl      229: extern struct cpu_info *cpu_info[X86_MAXPROCS];
1.82      fvdl      230:
1.109     junyoung  231: void cpu_boot_secondary_processors(void);
                    232: void cpu_init_idle_pcbs(void);
1.82      fvdl      233:
                    234: #else /* !MULTIPROCESSOR */
                    235:
1.97      fvdl      236: #define        X86_MAXPROCS            1
1.82      fvdl      237: #define        curcpu()                (&cpu_info_primary)
1.95      thorpej   238:
1.1       cgd       239: /*
                    240:  * definitions of cpu-dependent requirements
                    241:  * referenced in generic code
                    242:  */
1.82      fvdl      243: #define        cpu_number()            0
1.89      fvdl      244: #define CPU_IS_PRIMARY(ci)     1
1.82      fvdl      245:
1.131     ad        246: #define aston(l)               ((l)->l_md.md_astpending = 1)
                    247:
                    248: #endif /* MULTIPROCESSOR */
                    249:
1.82      fvdl      250: /*
                    251:  * Preempt the current process if in interrupt from user mode,
                    252:  * or after the current trap/syscall if in system mode.
                    253:  */
1.131     ad        254: extern void cpu_need_resched(struct cpu_info *);
1.94      fvdl      255:
1.120     perry     256: extern uint32_t cpus_attached;
1.82      fvdl      257:
                    258: #define        curpcb                  curcpu()->ci_curpcb
1.95      thorpej   259: #define        curlwp                  curcpu()->ci_curlwp
1.1       cgd       260:
                    261: /*
1.18      mycroft   262:  * Arguments to hardclock, softclock and statclock
1.1       cgd       263:  * encapsulate the previous machine state in an opaque
                    264:  * clockframe; for now, use generic intrframe.
                    265:  */
1.118     cube      266: struct clockframe {
                    267:        struct intrframe cf_if;
                    268: };
1.1       cgd       269:
1.118     cube      270: #define        CLKF_USERMODE(frame)    USERMODE((frame)->cf_if.if_cs, (frame)->cf_if.if_eflags)
                    271: #define        CLKF_PC(frame)          ((frame)->cf_if.if_eip)
1.130     yamt      272: #define        CLKF_INTR(frame)        (curcpu()->ci_idepth > 0)
1.67      mycroft   273:
                    274: /*
                    275:  * This is used during profiling to integrate system time.  It can safely
                    276:  * assume that the process is resident.
                    277:  */
1.95      thorpej   278: #define        LWP_PC(l)               ((l)->l_md.md_regs->tf_eip)
1.12      mycroft   279:
                    280: /*
                    281:  * Give a profiling tick to the current process when the user profiling
                    282:  * buffer pages are invalid.  On the i386, request an ast to send us
                    283:  * through trap(), marking the proc as needing a profiling tick.
1.1       cgd       284:  */
1.131     ad        285: extern void    cpu_need_proftick(struct lwp *l);
1.1       cgd       286:
                    287: /*
1.131     ad        288:  * Notify the LWP l that it has a signal pending, process as soon as
                    289:  * possible.
1.1       cgd       290:  */
1.131     ad        291: extern void    cpu_signotify(struct lwp *);
1.26      mycroft   292:
                    293: /*
                    294:  * We need a machine-independent name for this.
                    295:  */
1.109     junyoung  296: extern void (*delay_func)(int);
1.82      fvdl      297: struct timeval;
                    298:
                    299: #define        DELAY(x)                (*delay_func)(x)
                    300: #define delay(x)               (*delay_func)(x)
1.1       cgd       301:
                    302: /*
1.5       cgd       303:  * pull in #defines for kinds of processors
1.1       cgd       304:  */
1.15      mycroft   305: #include <machine/cputypes.h>
1.2       cgd       306:
1.38      fvdl      307: struct cpu_nocpuid_nameclass {
                    308:        int cpu_vendor;
                    309:        const char *cpu_vendorname;
                    310:        const char *cpu_name;
                    311:        int cpu_class;
1.109     junyoung  312:        void (*cpu_setup)(struct cpu_info *);
                    313:        void (*cpu_cacheinfo)(struct cpu_info *);
                    314:        void (*cpu_info)(struct cpu_info *);
1.38      fvdl      315: };
                    316:
                    317:
                    318: struct cpu_cpuid_nameclass {
                    319:        const char *cpu_id;
                    320:        int cpu_vendor;
                    321:        const char *cpu_vendorname;
                    322:        struct cpu_cpuid_family {
                    323:                int cpu_class;
                    324:                const char *cpu_models[CPU_MAXMODEL+2];
1.109     junyoung  325:                void (*cpu_setup)(struct cpu_info *);
                    326:                void (*cpu_probe)(struct cpu_info *);
                    327:                void (*cpu_info)(struct cpu_info *);
1.38      fvdl      328:        } cpu_family[CPU_MAXFAMILY - CPU_MINFAMILY + 1];
1.6       cgd       329: };
                    330:
1.62      thorpej   331: extern int biosbasemem;
                    332: extern int biosextmem;
1.102     drochner  333: extern unsigned int cpu_feature;
1.114     lukem     334: extern unsigned int cpu_feature2;
1.133     daniel    335: extern unsigned int cpu_feature_padlock;
1.3       cgd       336: extern int cpu;
1.8       cgd       337: extern int cpu_class;
1.114     lukem     338: extern char cpu_brand_string[];
1.66      jdolecek  339: extern const struct cpu_nocpuid_nameclass i386_nocpuid_cpus[];
                    340: extern const struct cpu_cpuid_nameclass i386_cpuid_cpus[];
1.74      thorpej   341:
1.75      thorpej   342: extern int i386_use_fxsave;
                    343: extern int i386_has_sse;
                    344: extern int i386_has_sse2;
1.34      christos  345:
                    346: /* machdep.c */
1.109     junyoung  347: void   dumpconf(void);
                    348: int    cpu_maxproc(void);
                    349: void   cpu_reset(void);
                    350: void   i386_init_pcb_tss_ldt(struct cpu_info *);
                    351: void   i386_proc0_tss_ldt_init(void);
1.98      fvdl      352:
                    353: /* identcpu.c */
1.129     xtraeme   354: #ifdef ENHANCED_SPEEDSTEP
1.128     xtraeme   355: extern int bus_clock;
1.129     xtraeme   356: #endif
1.98      fvdl      357: extern int tmx86_has_longrun;
                    358: extern u_int crusoe_longrun;
                    359: extern u_int crusoe_frequency;
                    360: extern u_int crusoe_voltage;
                    361: extern u_int crusoe_percentage;
                    362: extern u_int tmx86_set_longrun_mode(u_int);
                    363: void tmx86_get_longrun_status_all(void);
                    364: u_int tmx86_get_longrun_mode(void);
1.109     junyoung  365: void identifycpu(struct cpu_info *);
1.34      christos  366:
1.95      thorpej   367: /* vm_machdep.c */
1.109     junyoung  368: void   cpu_proc_fork(struct proc *, struct proc *);
1.95      thorpej   369:
1.34      christos  370: /* locore.s */
                    371: struct region_descriptor;
1.109     junyoung  372: void   lgdt(struct region_descriptor *);
                    373: void   fillw(short, void *, size_t);
1.34      christos  374:
                    375: struct pcb;
1.109     junyoung  376: void   savectx(struct pcb *);
                    377: void   proc_trampoline(void);
1.34      christos  378:
                    379: /* clock.c */
1.124     kardel    380: void   initrtclock(u_long);
1.109     junyoung  381: void   startrtclock(void);
                    382: void   i8254_delay(int);
                    383: void   i8254_microtime(struct timeval *);
                    384: void   i8254_initclocks(void);
1.82      fvdl      385:
                    386: /* cpu.c */
                    387:
1.109     junyoung  388: void   cpu_probe_features(struct cpu_info *);
1.34      christos  389:
                    390: /* npx.c */
1.109     junyoung  391: void   npxsave_lwp(struct lwp *, int);
                    392: void   npxsave_cpu(struct cpu_info *, int);
1.36      christos  393:
                    394: /* vm_machdep.c */
1.134     christos  395: int kvtop(void *);
1.34      christos  396:
                    397: #ifdef MATH_EMULATE
                    398: /* math_emulate.c */
1.109     junyoung  399: int    math_emulate(struct trapframe *, ksiginfo_t *);
1.3       cgd       400: #endif
1.34      christos  401:
                    402: #ifdef USER_LDT
                    403: /* sys_machdep.h */
1.109     junyoung  404: int    i386_get_ldt(struct lwp *, void *, register_t *);
                    405: int    i386_set_ldt(struct lwp *, void *, register_t *);
1.34      christos  406: #endif
                    407:
                    408: /* isa_machdep.c */
1.109     junyoung  409: void   isa_defaultirq(void);
                    410: int    isa_nmi(void);
1.34      christos  411:
                    412: #ifdef VM86
                    413: /* vm86.c */
1.109     junyoung  414: void   vm86_gpfault(struct lwp *, int);
1.34      christos  415: #endif /* VM86 */
1.58      drochner  416:
                    417: /* consinit.c */
1.109     junyoung  418: void kgdb_port_init(void);
1.59      drochner  419:
                    420: /* bus_machdep.c */
1.109     junyoung  421: void x86_bus_space_init(void);
                    422: void x86_bus_space_mallocok(void);
1.34      christos  423:
1.108     simonb    424: #include <machine/psl.h>       /* Must be after struct cpu_info declaration */
                    425:
1.114     lukem     426: /* est.c */
1.128     xtraeme   427: void   est_init(struct cpu_info *, int);
1.114     lukem     428:
1.34      christos  429: #endif /* _KERNEL */
1.19      cgd       430:
1.82      fvdl      431: /*
1.19      cgd       432:  * CTL_MACHDEP definitions.
                    433:  */
                    434: #define        CPU_CONSDEV             1       /* dev_t: console terminal device */
1.37      fvdl      435: #define        CPU_BIOSBASEMEM         2       /* int: bios-reported base mem (K) */
                    436: #define        CPU_BIOSEXTMEM          3       /* int: bios-reported ext. mem (K) */
                    437: #define        CPU_NKPDE               4       /* int: number of kernel PDEs */
1.40      drochner  438: #define        CPU_BOOTED_KERNEL       5       /* string: booted kernel name */
1.78      christos  439: #define CPU_DISKINFO           6       /* struct disklist *:
                    440:                                         * disk geometry information */
                    441: #define CPU_FPU_PRESENT                7       /* int: FPU is present */
                    442: #define        CPU_OSFXSR              8       /* int: OS uses FXSAVE/FXRSTOR */
                    443: #define        CPU_SSE                 9       /* int: OS/CPU supports SSE */
                    444: #define        CPU_SSE2                10      /* int: OS/CPU supports SSE2 */
                    445: #define CPU_TMLR_MODE          11      /* int: longrun mode
                    446:                                         * 0: minimum frequency
                    447:                                         * 1: economy
                    448:                                         * 2: performance
                    449:                                         * 3: maximum frequency
                    450:                                         */
                    451: #define CPU_TMLR_FREQUENCY     12      /* int: current frequency */
                    452: #define CPU_TMLR_VOLTAGE       13      /* int: curret voltage */
                    453: #define CPU_TMLR_PERCENTAGE    14      /* int: current clock percentage */
1.76      christos  454: #define        CPU_MAXID               15      /* number of valid machdep ids */
1.19      cgd       455:
                    456: #define        CTL_MACHDEP_NAMES { \
                    457:        { 0, 0 }, \
                    458:        { "console_device", CTLTYPE_STRUCT }, \
1.37      fvdl      459:        { "biosbasemem", CTLTYPE_INT }, \
                    460:        { "biosextmem", CTLTYPE_INT }, \
                    461:        { "nkpde", CTLTYPE_INT }, \
1.40      drochner  462:        { "booted_kernel", CTLTYPE_STRING }, \
1.52      fvdl      463:        { "diskinfo", CTLTYPE_STRUCT }, \
1.56      fvdl      464:        { "fpu_present", CTLTYPE_INT }, \
1.75      thorpej   465:        { "osfxsr", CTLTYPE_INT }, \
                    466:        { "sse", CTLTYPE_INT }, \
                    467:        { "sse2", CTLTYPE_INT }, \
1.76      christos  468:        { "tm_longrun_mode", CTLTYPE_INT }, \
                    469:        { "tm_longrun_frequency", CTLTYPE_INT }, \
                    470:        { "tm_longrun_voltage", CTLTYPE_INT }, \
                    471:        { "tm_longrun_percentage", CTLTYPE_INT }, \
1.19      cgd       472: }
1.52      fvdl      473:
                    474: /*
                    475:  * Structure for CPU_DISKINFO sysctl call.
                    476:  * XXX this should be somewhere else.
                    477:  */
                    478: #define MAX_BIOSDISKS  16
                    479:
                    480: struct disklist {
                    481:        int dl_nbiosdisks;                         /* number of bios disks */
                    482:        struct biosdisk_info {
                    483:                int bi_dev;                        /* BIOS device # (0x80 ..) */
                    484:                int bi_cyl;                        /* cylinders on disk */
                    485:                int bi_head;                       /* heads per track */
                    486:                int bi_sec;                        /* sectors per track */
1.120     perry     487:                uint64_t bi_lbasecs;               /* total sec. (iff ext13) */
1.52      fvdl      488: #define BIFLAG_INVALID         0x01
                    489: #define BIFLAG_EXTINT13                0x02
                    490:                int bi_flags;
                    491:        } dl_biosdisks[MAX_BIOSDISKS];
                    492:
                    493:        int dl_nnativedisks;                       /* number of native disks */
                    494:        struct nativedisk_info {
                    495:                char ni_devname[16];               /* native device name */
                    496:                int ni_nmatches;                   /* # of matches w/ BIOS */
                    497:                int ni_biosmatches[MAX_BIOSDISKS]; /* indices in dl_biosdisks */
                    498:        } dl_nativedisks[1];                       /* actually longer */
                    499: };
1.14      mycroft   500: #endif /* !_I386_CPU_H_ */

CVSweb <webmaster@jp.NetBSD.org>