[BACK]Return to cpu.h CVS log [TXT][DIR] Up to [local] / sys / arch / vax / include

Annotation of sys/arch/vax/include/cpu.h, Revision 1.1.1.1

1.1       nbrk        1: /*      $OpenBSD: cpu.h,v 1.25 2007/05/16 05:19:13 miod Exp $      */
                      2: /*      $NetBSD: cpu.h,v 1.41 1999/10/21 20:01:36 ragge Exp $      */
                      3:
                      4: /*
                      5:  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
                      6:  * All rights reserved.
                      7:  *
                      8:  * Redistribution and use in source and binary forms, with or without
                      9:  * modification, are permitted provided that the following conditions
                     10:  * are met:
                     11:  * 1. Redistributions of source code must retain the above copyright
                     12:  *    notice, this list of conditions and the following disclaimer.
                     13:  * 2. Redistributions in binary form must reproduce the above copyright
                     14:  *    notice, this list of conditions and the following disclaimer in the
                     15:  *    documentation and/or other materials provided with the distribution.
                     16:  * 3. All advertising materials mentioning features or use of this software
                     17:  *    must display the following acknowledgement:
                     18:  *      This product includes software developed at Ludd, University of Lule}
                     19:  * 4. The name of the author may not be used to endorse or promote products
                     20:  *    derived from this software without specific prior written permission
                     21:  *
                     22:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     23:  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     24:  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     25:  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     26:  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     27:  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
                     28:  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
                     29:  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     30:  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
                     31:  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     32:  */
                     33:
                     34: #ifndef _VAX_CPU_H_
                     35: #define _VAX_CPU_H_
                     36: #ifdef _KERNEL
                     37:
                     38: #include <sys/cdefs.h>
                     39: #include <sys/device.h>
                     40: #include <sys/evcount.h>
                     41:
                     42: #include <machine/mtpr.h>
                     43: #include <machine/pte.h>
                     44: #include <machine/pcb.h>
                     45: #include <machine/uvax.h>
                     46: #include <machine/psl.h>
                     47: #include <machine/trap.h>
                     48: #include <machine/intr.h>
                     49:
                     50: #define        cpu_wait(p)
                     51:
                     52: #include <sys/sched.h>
                     53: struct cpu_info {
                     54:        struct proc *ci_curproc;
                     55:
                     56:        struct schedstate_percpu ci_schedstate; /* scheduler state */
                     57: };
                     58:
                     59: extern struct cpu_info cpu_info_store;
                     60: #define        curcpu()        (&cpu_info_store)
                     61: #define cpu_number()   0
                     62: #define CPU_IS_PRIMARY(ci)     1
                     63: #define CPU_INFO_ITERATOR      int
                     64: #define CPU_INFO_FOREACH(cii, ci) \
                     65:        for (cii = 0, ci = curcpu(); ci != NULL; ci = NULL)
                     66:
                     67: /*
                     68:  * All cpu-dependent info is kept in this struct. Pointer to the
                     69:  * struct for the current cpu is set up in locore.c.
                     70:  */
                     71: struct cpu_dep {
                     72:        void    (*cpu_steal_pages)(void); /* pmap init before mm is on */
                     73:        int     (*cpu_mchk)(caddr_t);   /* Machine check handling */
                     74:        void    (*cpu_memerr)(void); /* Memory subsystem errors */
                     75:            /* Autoconfiguration */
                     76:        void    (*cpu_conf)(void);
                     77:        int     (*cpu_clkread)(time_t); /* Read cpu clock time */
                     78:        void    (*cpu_clkwrite)(void);  /* Write system time to cpu */
                     79:        short   cpu_vups;       /* speed of cpu */
                     80:        short   cpu_scbsz;      /* (estimated) size of system control block */
                     81:        void    (*cpu_halt)(void); /* Cpu dependent halt call */
                     82:        void    (*cpu_reboot)(int); /* Cpu dependent reboot call */
                     83:        void    (*cpu_clrf)(void); /* Clear cold/warm start flags */
                     84:        void    (*cpu_subconf)(struct device *);/*config cpu dep. devs */
                     85: };
                     86:
                     87: extern struct cpu_dep *dep_call; /* Holds pointer to current CPU struct. */
                     88:
                     89: struct clockframe {
                     90:         int     pc;
                     91:         int     ps;
                     92: };
                     93:
                     94: extern struct device *booted_from;
                     95: extern int mastercpu;
                     96: extern int bootdev;
                     97:
                     98: #define        setsoftnet()    mtpr(IPL_SOFTNET,PR_SIRR)
                     99: #define setsoftclock() mtpr(IPL_SOFTCLOCK,PR_SIRR)
                    100: #define        todr()          mfpr(PR_TODR)
                    101: /*
                    102:  * Preempt the current process if in interrupt from user mode,
                    103:  * or after the current trap/syscall if in system mode.
                    104:  */
                    105:
                    106: #define need_resched(ci){ \
                    107:        want_resched++; \
                    108:        mtpr(AST_OK,PR_ASTLVL); \
                    109:        }
                    110:
                    111: /*
                    112:  * Notify the current process (p) that it has a signal pending,
                    113:  * process as soon as possible.
                    114:  */
                    115:
                    116: #define signotify(p)     mtpr(AST_OK,PR_ASTLVL);
                    117:
                    118: extern int     want_resched;   /* resched() was called */
                    119:
                    120: /*
                    121:  * This is used during profiling to integrate system time.
                    122:  */
                    123: #define        PROC_PC(p)      (((struct trapframe *)((p)->p_addr->u_pcb.framep))->pc)
                    124:
                    125: /*
                    126:  * Give a profiling tick to the current process when the user profiling
                    127:  * buffer pages are invalid.  On the vax, request an ast to send us
                    128:  * through trap, marking the proc as needing a profiling tick.
                    129:  */
                    130: #define need_proftick(p) mtpr(AST_OK,PR_ASTLVL)
                    131:
                    132: /*
                    133:  * This defines the I/O device register space size in pages.
                    134:  */
                    135: #define        IOSPSZ  ((64*1024) / VAX_NBPG)  /* 64k == 128 pages */
                    136:
                    137: struct device;
                    138:
                    139: extern char cpu_model[100];
                    140:
                    141: /* Some low-level prototypes */
                    142: int    badaddr(caddr_t, int);
                    143: void   dumpconf(void);
                    144: void   dumpsys(void);
                    145: void   swapconf(void);
                    146: void   disk_printtype(int, int);
                    147: void   disk_reallymapin(struct buf *, pt_entry_t *, int, int);
                    148: vaddr_t        vax_map_physmem(paddr_t, int);
                    149: void   vax_unmap_physmem(vaddr_t, int);
                    150: void   ioaccess(vaddr_t, paddr_t, int);
                    151: void   iounaccess(vaddr_t, int);
                    152: void   findcpu(void);
                    153: #ifdef DDB
                    154: int    kdbrint(int);
                    155: #endif
                    156: #endif /* _KERNEL */
                    157:
                    158: /*
                    159:  * CTL_MACHDEP definitions.
                    160:  */
                    161: #define CPU_CONSDEV            1       /* dev_t: console terminal device */
                    162: #define        CPU_LED_BLINK           2       /* int: display led patterns */
                    163: #define CPU_MAXID              3       /* number of valid machdep ids */
                    164:
                    165: #define CTL_MACHDEP_NAMES { \
                    166:        { 0, 0 }, \
                    167:        { "console_device", CTLTYPE_STRUCT }, \
                    168:        { "led_blink", CTLTYPE_INT } \
                    169: }
                    170:
                    171: #endif /* _VAX_CPU_H_ */

CVSweb