Annotation of GNUtools/cctools/include/mach/machine.h, revision 1.1

1.1     ! root        1: /* 
        !             2:  * Mach Operating System
        !             3:  * Copyright (c) 1989 Carnegie-Mellon University
        !             4:  * Copyright (c) 1988 Carnegie-Mellon University
        !             5:  * Copyright (c) 1987 Carnegie-Mellon University
        !             6:  * All rights reserved.  The CMU software License Agreement specifies
        !             7:  * the terms and conditions for use and redistribution.
        !             8:  */
        !             9: /*
        !            10:  * HISTORY
        !            11:  * $Log:       machine.h,v $
        !            12:  *  2 July 1992        Mac Gillon at NeXT
        !            13:  *     Changed HPPA subtypes to follow our practice. 
        !            14:  *
        !            15:  * 11 September 1992 David E. Bohman at NeXT
        !            16:  *     Added CPU_SUBTYPE_486SX to the i386 family.
        !            17:  *
        !            18:  * 16 July 1992 David E. Bohman at NeXT
        !            19:  *     Added CPU_SUBTYPE_586 to the i386 family.
        !            20:  *
        !            21:  * 17-Dec-91  Peter King (king) at NeXT
        !            22:  *     Added support for the XXX_ALL subtypes.  These are used to
        !            23:  *     tag object files that can run on any implementation of a
        !            24:  *     particular family.
        !            25:  *
        !            26:  *  1-Mar-90  John Seamons (jks) at NeXT
        !            27:  *     Redefined cpu_type and cpu_subtype definitions to indicate processor
        !            28:  *     architecture instead of product types for the MC680x0.
        !            29:  *
        !            30:  * Revision 2.15  89/10/11  14:39:56  dlb
        !            31:  *     Removed should_exit - replaced by action thread.
        !            32:  *     [89/01/25            dlb]
        !            33:  * 
        !            34:  * Revision 2.14  89/07/14  17:21:39  rvb
        !            35:  *     Added CPU types and subtypes for MC68030, MC68040, MC88000,
        !            36:  *     HPPA, ARM and Sun4-SPARC.
        !            37:  *     [89/07/13            mrt]
        !            38:  * 
        !            39:  * Revision 2.12  89/05/30  10:38:58  rvb
        !            40:  *     Add R2000 machine types.
        !            41:  *     [89/05/30  08:28:53  rvb]
        !            42:  * 
        !            43:  * Revision 2.11  89/04/18  16:43:32  mwyoung
        !            44:  *     Use <machine/vm_types.h> rather than <vm/vm_param.h> to get
        !            45:  *     VM types.  Remove old history... none of it was insightful.
        !            46:  * 
        !            47:  *     The variable declarations should be moved elsewhere.
        !            48:  *     [89/01/24            mwyoung]
        !            49:  * 
        !            50:  */
        !            51: /*
        !            52:  *     Machine independent machine abstraction.
        !            53:  *     Copyright (C) 1986, Avadis Tevanian, Jr.
        !            54:  */
        !            55: 
        !            56: #ifndef        _MACH_MACHINE_H_
        !            57: #define _MACH_MACHINE_H_
        !            58: 
        !            59: #import <mach/machine/vm_types.h>
        !            60: #import <mach/boolean.h>
        !            61: 
        !            62: /*
        !            63:  *     For each host, there is a maximum possible number of
        !            64:  *     cpus that may be available in the system.  This is the
        !            65:  *     compile-time constant NCPUS, which is defined in cpus.h.
        !            66:  *
        !            67:  *     In addition, there is a machine_slot specifier for each
        !            68:  *     possible cpu in the system.
        !            69:  */
        !            70: 
        !            71: struct machine_info {
        !            72:        int             major_version;  /* kernel major version id */
        !            73:        int             minor_version;  /* kernel minor version id */
        !            74:        int             max_cpus;       /* max number of cpus compiled */
        !            75:        int             avail_cpus;     /* number actually available */
        !            76:        vm_size_t       memory_size;    /* size of memory in bytes */
        !            77: };
        !            78: 
        !            79: typedef struct machine_info    *machine_info_t;
        !            80: typedef struct machine_info    machine_info_data_t;    /* bogus */
        !            81: 
        !            82: typedef int    cpu_type_t;
        !            83: typedef int    cpu_subtype_t;
        !            84: 
        !            85: #define CPU_STATE_MAX          3
        !            86: 
        !            87: #define CPU_STATE_USER         0
        !            88: #define CPU_STATE_SYSTEM       1
        !            89: #define CPU_STATE_IDLE         2
        !            90: 
        !            91: struct machine_slot {
        !            92:        boolean_t       is_cpu;         /* is there a cpu in this slot? */
        !            93:        cpu_type_t      cpu_type;       /* type of cpu */
        !            94:        cpu_subtype_t   cpu_subtype;    /* subtype of cpu */
        !            95:        volatile boolean_t running;     /* is cpu running */
        !            96:        long            cpu_ticks[CPU_STATE_MAX];
        !            97:        int             clock_freq;     /* clock interrupt frequency */
        !            98: };
        !            99: 
        !           100: typedef struct machine_slot    *machine_slot_t;
        !           101: typedef struct machine_slot    machine_slot_data_t;    /* bogus */
        !           102: 
        !           103: #ifdef KERNEL
        !           104: extern struct machine_info     machine_info;
        !           105: extern struct machine_slot     machine_slot[];
        !           106: 
        !           107: extern vm_offset_t             interrupt_stack[];
        !           108: #endif KERNEL
        !           109: 
        !           110: /*
        !           111:  *     Machine types known by all.
        !           112:  */
        !           113:  
        !           114: #define CPU_TYPE_ANY           ((cpu_type_t) -1)
        !           115: 
        !           116: #define CPU_TYPE_VAX           ((cpu_type_t) 1)
        !           117: #define CPU_TYPE_ROMP          ((cpu_type_t) 2)
        !           118: #define CPU_TYPE_NS32032       ((cpu_type_t) 4)
        !           119: #define CPU_TYPE_NS32332        ((cpu_type_t) 5)
        !           120: #define        CPU_TYPE_MC680x0        ((cpu_type_t) 6)
        !           121: #define CPU_TYPE_I386          ((cpu_type_t) 7)
        !           122: #define CPU_TYPE_MIPS          ((cpu_type_t) 8)
        !           123: #define CPU_TYPE_NS32532        ((cpu_type_t) 9)
        !           124: #define CPU_TYPE_HPPA           ((cpu_type_t) 11)
        !           125: #define CPU_TYPE_ARM           ((cpu_type_t) 12)
        !           126: #define CPU_TYPE_MC88000       ((cpu_type_t) 13)
        !           127: #define CPU_TYPE_SPARC         ((cpu_type_t) 14)
        !           128: #define CPU_TYPE_I860          ((cpu_type_t) 15) // big-endian
        !           129: #define        CPU_TYPE_I860_LITTLE    ((cpu_type_t) 16) // little-endian
        !           130: #define CPU_TYPE_RS6000                ((cpu_type_t) 17)
        !           131: #define CPU_TYPE_MC98000       ((cpu_type_t) 18)
        !           132:                
        !           133: 
        !           134: /*
        !           135:  *     Machine subtypes (these are defined here, instead of in a machine
        !           136:  *     dependent directory, so that any program can get all definitions
        !           137:  *     regardless of where is it compiled).
        !           138:  */
        !           139: 
        !           140: /*
        !           141:  *     Object files that are hand-crafted to run on any
        !           142:  *     implementation of an architecture are tagged with
        !           143:  *     CPU_SUBTYPE_MULTIPLE.  This functions essentially the same as
        !           144:  *     the "ALL" subtype of an architecture except that it allows us
        !           145:  *     to easily find object files that may need to be modified
        !           146:  *     whenever a new implementation of an architecture comes out.
        !           147:  *
        !           148:  *     It is the responsibility of the implementor to make sure the
        !           149:  *     software handles unsupported implementations elegantly.
        !           150:  */
        !           151: #define        CPU_SUBTYPE_MULTIPLE    ((cpu_subtype_t) -1)
        !           152: 
        !           153: 
        !           154: /*
        !           155:  *     VAX subtypes (these do *not* necessary conform to the actual cpu
        !           156:  *     ID assigned by DEC available via the SID register).
        !           157:  */
        !           158: 
        !           159: #define        CPU_SUBTYPE_VAX_ALL     ((cpu_subtype_t) 0) 
        !           160: #define CPU_SUBTYPE_VAX780     ((cpu_subtype_t) 1)
        !           161: #define CPU_SUBTYPE_VAX785     ((cpu_subtype_t) 2)
        !           162: #define CPU_SUBTYPE_VAX750     ((cpu_subtype_t) 3)
        !           163: #define CPU_SUBTYPE_VAX730     ((cpu_subtype_t) 4)
        !           164: #define CPU_SUBTYPE_UVAXI      ((cpu_subtype_t) 5)
        !           165: #define CPU_SUBTYPE_UVAXII     ((cpu_subtype_t) 6)
        !           166: #define CPU_SUBTYPE_VAX8200    ((cpu_subtype_t) 7)
        !           167: #define CPU_SUBTYPE_VAX8500    ((cpu_subtype_t) 8)
        !           168: #define CPU_SUBTYPE_VAX8600    ((cpu_subtype_t) 9)
        !           169: #define CPU_SUBTYPE_VAX8650    ((cpu_subtype_t) 10)
        !           170: #define CPU_SUBTYPE_VAX8800    ((cpu_subtype_t) 11)
        !           171: #define CPU_SUBTYPE_UVAXIII    ((cpu_subtype_t) 12)
        !           172: 
        !           173: /*
        !           174:  *     ROMP subtypes.
        !           175:  */
        !           176: 
        !           177: #define        CPU_SUBTYPE_RT_ALL      ((cpu_subtype_t) 0)
        !           178: #define CPU_SUBTYPE_RT_PC      ((cpu_subtype_t) 1)
        !           179: #define CPU_SUBTYPE_RT_APC     ((cpu_subtype_t) 2)
        !           180: #define CPU_SUBTYPE_RT_135     ((cpu_subtype_t) 3)
        !           181: 
        !           182: /*
        !           183:  *     32032/32332/32532 subtypes.
        !           184:  */
        !           185: 
        !           186: #define        CPU_SUBTYPE_MMAX_ALL        ((cpu_subtype_t) 0)
        !           187: #define CPU_SUBTYPE_MMAX_DPC       ((cpu_subtype_t) 1) /* 032 CPU */
        !           188: #define CPU_SUBTYPE_SQT                    ((cpu_subtype_t) 2)
        !           189: #define CPU_SUBTYPE_MMAX_APC_FPU    ((cpu_subtype_t) 3)        /* 32081 FPU */
        !           190: #define CPU_SUBTYPE_MMAX_APC_FPA    ((cpu_subtype_t) 4)        /* Weitek FPA */
        !           191: #define CPU_SUBTYPE_MMAX_XPC       ((cpu_subtype_t) 5) /* 532 CPU */
        !           192: 
        !           193: /*
        !           194:  *     I386 subtypes.
        !           195:  */
        !           196: 
        !           197: #define        CPU_SUBTYPE_I386_ALL    ((cpu_subtype_t) 3)
        !           198: #define CPU_SUBTYPE_386                ((cpu_subtype_t) 3)
        !           199: #define CPU_SUBTYPE_486                ((cpu_subtype_t) 4)
        !           200: #define CPU_SUBTYPE_486SX      ((cpu_subtype_t) 4 + 128)
        !           201: #define CPU_SUBTYPE_586                ((cpu_subtype_t) 5)
        !           202: #define CPU_SUBTYPE_586SX      ((cpu_subtype_t) 5 + 128)
        !           203: 
        !           204: /*
        !           205:  *     Mips subtypes.
        !           206:  */
        !           207: 
        !           208: #define        CPU_SUBTYPE_MIPS_ALL    ((cpu_subtype_t) 0)
        !           209: #define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
        !           210: #define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
        !           211: #define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
        !           212: #define CPU_SUBTYPE_MIPS_R2000a        ((cpu_subtype_t) 4)
        !           213: 
        !           214: /*
        !           215:  *     680x0 subtypes
        !           216:  *
        !           217:  * The subtype definitions here are unusual for historical reasons.
        !           218:  * NeXT used to consider 68030 code as generic 68000 code.  For
        !           219:  * backwards compatability:
        !           220:  * 
        !           221:  *     CPU_SUBTYPE_MC68030 symbol has been preserved for source code
        !           222:  *     compatability.
        !           223:  *
        !           224:  *     CPU_SUBTYPE_MC680x0_ALL has been defined to be the same
        !           225:  *     subtype as CPU_SUBTYPE_MC68030 for binary comatability.
        !           226:  *
        !           227:  *     CPU_SUBTYPE_MC68030_ONLY has been added to allow new object
        !           228:  *     files to be tagged as containing 68030-specific instructions.
        !           229:  */
        !           230: 
        !           231: #define        CPU_SUBTYPE_MC680x0_ALL         ((cpu_subtype_t) 1)
        !           232: #define CPU_SUBTYPE_MC68030            ((cpu_subtype_t) 1) /* compat */
        !           233: #define CPU_SUBTYPE_MC68040            ((cpu_subtype_t) 2) 
        !           234: #define        CPU_SUBTYPE_MC68030_ONLY        ((cpu_subtype_t) 3)
        !           235: 
        !           236: /*
        !           237:  *     HPPA subtypes for Hewlett-Packard HP-PA family of
        !           238:  *     risc processors. Port by NeXT to 700 series. 
        !           239:  */
        !           240: 
        !           241: #define        CPU_SUBTYPE_HPPA_ALL            ((cpu_subtype_t) 0)
        !           242: #define CPU_SUBTYPE_HPPA_7100          ((cpu_subtype_t) 0) /* compat */
        !           243: #define CPU_SUBTYPE_HPPA_7100LC                ((cpu_subtype_t) 1)
        !           244: 
        !           245: /* 
        !           246:  *     Acorn subtypes - Acorn Risc Machine port done by
        !           247:  *             Olivetti System Software Laboratory
        !           248:  */
        !           249: 
        !           250: #define        CPU_SUBTYPE_ARM_ALL             ((cpu_subtype_t) 0)
        !           251: #define CPU_SUBTYPE_ARM_A500_ARCH      ((cpu_subtype_t) 1)
        !           252: #define CPU_SUBTYPE_ARM_A500           ((cpu_subtype_t) 2)
        !           253: #define CPU_SUBTYPE_ARM_A440           ((cpu_subtype_t) 3)
        !           254: #define CPU_SUBTYPE_ARM_M4             ((cpu_subtype_t) 4)
        !           255: #define CPU_SUBTYPE_ARM_A680           ((cpu_subtype_t) 5)
        !           256: 
        !           257: /*
        !           258:  *     MC88000 subtypes
        !           259:  */
        !           260: #define        CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0)
        !           261: #define CPU_SUBTYPE_MMAX_JPC   ((cpu_subtype_t) 1)
        !           262: #define CPU_SUBTYPE_MC88100    ((cpu_subtype_t) 1)
        !           263: #define CPU_SUBTYPE_MC88110    ((cpu_subtype_t) 2)
        !           264: 
        !           265: /*
        !           266:  *     MC98000 (PowerPC) subtypes
        !           267:  */
        !           268: #define        CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0)
        !           269: #define CPU_SUBTYPE_MC98601    ((cpu_subtype_t) 1)
        !           270: 
        !           271: /*
        !           272:  *     I860 subtypes
        !           273:  */
        !           274: #define CPU_SUBTYPE_I860_ALL   ((cpu_subtype_t) 0)
        !           275: #define CPU_SUBTYPE_I860_860   ((cpu_subtype_t) 1)
        !           276: 
        !           277: /*
        !           278:  *     I860 subtypes for NeXT-internal backwards compatability.
        !           279:  *     These constants will be going away.  DO NOT USE THEM!!!
        !           280:  */
        !           281: #define CPU_SUBTYPE_LITTLE_ENDIAN      ((cpu_subtype_t) 0)
        !           282: #define CPU_SUBTYPE_BIG_ENDIAN         ((cpu_subtype_t) 1)
        !           283: 
        !           284: /*
        !           285:  *     I860_LITTLE subtypes
        !           286:  */
        !           287: #define        CPU_SUBTYPE_I860_LITTLE_ALL     ((cpu_subtype_t) 0)
        !           288: #define        CPU_SUBTYPE_I860_LITTLE ((cpu_subtype_t) 1)
        !           289: 
        !           290: /*
        !           291:  *     RS6000 subtypes
        !           292:  */
        !           293: #define        CPU_SUBTYPE_RS6000_ALL  ((cpu_subtype_t) 0)
        !           294: #define CPU_SUBTYPE_RS6000     ((cpu_subtype_t) 1)
        !           295: 
        !           296: /*
        !           297:  *     Sun4 subtypes - port done at CMU
        !           298:  */
        !           299: #define        CPU_SUBTYPE_SUN4_ALL            ((cpu_subtype_t) 0)
        !           300: #define CPU_SUBTYPE_SUN4_260           ((cpu_subtype_t) 1)
        !           301: #define CPU_SUBTYPE_SUN4_110           ((cpu_subtype_t) 2)
        !           302: 
        !           303: #define        CPU_SUBTYPE_SPARC_ALL           ((cpu_subtype_t) 0)
        !           304: 
        !           305: #endif _MACH_MACHINE_H_

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.