Annotation of kernel/machdep/i386/genassym.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
        !             3:  *
        !             4:  * @APPLE_LICENSE_HEADER_START@
        !             5:  * 
        !             6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
        !             7:  * Reserved.  This file contains Original Code and/or Modifications of
        !             8:  * Original Code as defined in and that are subject to the Apple Public
        !             9:  * Source License Version 1.1 (the "License").  You may not use this file
        !            10:  * except in compliance with the License.  Please obtain a copy of the
        !            11:  * License at http://www.apple.com/publicsource and read it before using
        !            12:  * this file.
        !            13:  * 
        !            14:  * The Original Code and all software distributed under the License are
        !            15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
        !            16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
        !            17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
        !            18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
        !            19:  * License for the specific language governing rights and limitations
        !            20:  * under the License.
        !            21:  * 
        !            22:  * @APPLE_LICENSE_HEADER_END@
        !            23:  */
        !            24: 
        !            25: /* 
        !            26:  * Mach Operating System
        !            27:  * Copyright (c) 1989 Carnegie-Mellon University
        !            28:  * Copyright (c) 1988 Carnegie-Mellon University
        !            29:  * All rights reserved.  The CMU software License Agreement specifies
        !            30:  * the terms and conditions for use and redistribution.
        !            31:  */
        !            32: /* 
        !            33:  * HISTORY
        !            34:  * Revision 1.1.1.1  1997/09/30 02:45:12  wsanchez
        !            35:  * Import of kernel from umeshv/kernel
        !            36:  *
        !            37:  *
        !            38:  * 4-Jan-95 Curtis Galloway (galloway) at NeXT
        !            39:  *     Created cross-buildable version from old genassym.c.
        !            40:  *
        !            41:  * 16-Mar-93  Curtis Galloway (galloway) at NeXT
        !            42:  *      Remove obsolete 68k timer references.
        !            43:  *
        !            44:  * Revision 1.4.1.3  91/03/28  08:43:49  rvb
        !            45:  *     Flush THREAD_EXIT & THREAD_EXIT_CODE for X134.
        !            46:  *     [91/03/23            rvb]
        !            47:  * 
        !            48:  * Revision 1.4.1.2  90/02/09  17:23:20  rvb
        !            49:  *     Constants for Mach emulation support.
        !            50:  *     [90/02/09            rvb]
        !            51:  * 
        !            52:  * Revision 1.4.1.1  90/01/02  13:50:28  rvb
        !            53:  *     Flush MACH_TIME.
        !            54:  * 
        !            55:  * Revision 1.4  89/04/05  12:57:30  rvb
        !            56:  *     X78: no more vmmeter
        !            57:  *     [89/03/24            rvb]
        !            58:  * 
        !            59:  * Revision 1.3  89/02/26  12:31:18  gm0w
        !            60:  *     Changes for cleanup.
        !            61:  * 
        !            62:  * 31-Dec-88  Robert Baron (rvb) at Carnegie-Mellon University
        !            63:  *     Derived from MACH2.0 vax release.
        !            64:  *     Still a lot of dead wood to cleanup.
        !            65:  *
        !            66:  * 11-Dec-87  Stephen Schwab (schwab) at Carnegie-Mellon University
        !            67:  *     For 650, define ssc timer symbolic offsets.
        !            68:  *
        !            69:  */
        !            70: 
        !            71: #import <confdep.h>
        !            72: 
        !            73: #import <stddef.h>
        !            74: #import <mach/mach_types.h>
        !            75: 
        !            76: #import <sys/param.h>
        !            77: #import <sys/buf.h>
        !            78: #import <sys/vmparam.h>
        !            79: #import <sys/dir.h>
        !            80: #import <sys/proc.h>
        !            81: #import <sys/user.h>
        !            82: #import <sys/mbuf.h>
        !            83: #import <sys/msgbuf.h>
        !            84: 
        !            85: #import <kern/lock.h>
        !            86: 
        !            87: #import <kern/thread.h>
        !            88: #import <kern/task.h>
        !            89: 
        !            90: #import <fp_emul.h>
        !            91: #if    FP_EMUL
        !            92: #import <machdep/i386/fp_emul/fp_emul.h>
        !            93: #endif
        !            94: 
        !            95: int _ERR = offsetof(thread_saved_state_t, frame.err);
        !            96: int _EFL = offsetof(thread_saved_state_t, frame.eflags);
        !            97: int _EBP = offsetof(thread_saved_state_t, regs.ebp);
        !            98: int _P_PRI = offsetof(struct proc, p_priority);
        !            99: int _P_STAT = offsetof(struct proc, p_stat);
        !           100: int _P_SIG = offsetof(struct proc, p_siglist);
        !           101: int _P_FLAG = offsetof(struct proc, p_flag);
        !           102: int _SSLEEP = SSLEEP;
        !           103: int _SRUN = SRUN;
        !           104: int _RU_MINFLT = offsetof(struct rusage, ru_minflt);
        !           105: int _PR_BASE = offsetof(struct uprof, pr_base);
        !           106: int _PR_SIZE = offsetof(struct uprof, pr_size);
        !           107: int _PR_OFF = offsetof(struct uprof, pr_off);
        !           108: int _PR_SCALE = offsetof(struct uprof, pr_scale);
        !           109: int _U_AR0 = offsetof(struct uthread, uu_ar0);
        !           110: int _THREAD_PCB = offsetof(struct thread, pcb);
        !           111: int _THREAD_RECOVER = offsetof(struct thread, recover);
        !           112: int _THREAD_TASK = offsetof(struct thread, task);
        !           113: int _THREAD_AST = offsetof(struct thread, ast);
        !           114: int _AST_ZILCH = AST_ZILCH;
        !           115: //     sel_conv.sel = NULL_SEL;
        !           116: //int _NULLSEL = sel_conv.sel_data);
        !           117: sel_t _NULLSEL = NULL_SEL;
        !           118: //     sel_conv.sel = KCS_SEL;
        !           119: //int _KCSSEL = sel_conv.sel_data);
        !           120: sel_t _KCSSEL = KCS_SEL;
        !           121: //     sel_conv.sel = KDS_SEL;
        !           122: //int _KDSSEL = sel_conv.sel_data);
        !           123: sel_t _KDSSEL = KDS_SEL;
        !           124: //     sel_conv.sel = LCODE_SEL;
        !           125: //int _LCODESEL = sel_conv.sel_data);
        !           126: sel_t _LCODESEL = LCODE_SEL;
        !           127: //     sel_conv.sel = LDATA_SEL;
        !           128: //int _LDATASEL = sel_conv.sel_data);
        !           129: sel_t _LDATASEL = LDATA_SEL;
        !           130: int _VM_MIN_KERNEL_ADDRESS  = VM_MIN_KERNEL_ADDRESS;
        !           131: int _KERNEL_LINEAR_BASE  = KERNEL_LINEAR_BASE;
        !           132: int _KERN_FAILURE = KERN_FAILURE;
        !           133: 
        !           134: #if    FP_EMUL
        !           135: //     sel_conv.sel = FPSTATE_SEL;
        !           136: //int _FPSTATESEL = sel_conv.sel_data);
        !           137: int _sr_masks  = offsetof(fp_state_t, environ.control);
        !           138: int _sr_controls  = (offsetof(fp_state_t, environ.control)+1);
        !           139: int _sr_errors  =offsetof(fp_state_t, environ.status);
        !           140: int _sr_flags  = (offsetof(fp_state_t, environ.status)+1);
        !           141: int _sr_tags  = offsetof(fp_state_t, environ.tag);
        !           142: int _sr_instr_offset  = offsetof(fp_state_t, environ.ip);
        !           143: int _sr_instr_base  = offsetof(fp_state_t, environ.cs);
        !           144: int _sr_mem_offset  = offsetof(fp_state_t, environ.dp);
        !           145: int _sr_mem_base  = offsetof(fp_state_t, environ.ds);
        !           146: int _sr_regstack  = offsetof(fp_state_t, stack);
        !           147: 
        !           148: int _work_area  = offsetof(fp_emul_state_t, emul_work_area);
        !           149: int _mem_operand_pointer  = offsetof(fp_emul_state_t, emul_work_area.mem_operand_pointer);
        !           150: int _instruction_pointer  = offsetof(fp_emul_state_t, emul_work_area.instruction_pointer);
        !           151: int _operation_type  = offsetof(fp_emul_state_t, emul_work_area.operation_type);
        !           152: int _reg_num  = offsetof(fp_emul_state_t, emul_work_area.reg_num);
        !           153: int _op1_format  = offsetof(fp_emul_state_t, emul_work_area.op1_format);
        !           154: int _op1_location  = offsetof(fp_emul_state_t, emul_work_area.op1_location);
        !           155: int _op1_use_up  = offsetof(fp_emul_state_t, emul_work_area.op1_use_up);
        !           156: int _op2_format  = offsetof(fp_emul_state_t, emul_work_area.op2_format);
        !           157: int _op2_location  = offsetof(fp_emul_state_t, emul_work_area.op2_location);
        !           158: int _op2_use_up  = offsetof(fp_emul_state_t, emul_work_area.op2_use_up);
        !           159: int _result_format  = offsetof(fp_emul_state_t, emul_work_area.result_format);
        !           160: int _result_location  = offsetof(fp_emul_state_t, emul_work_area.result_location);
        !           161: int _result2_format  = offsetof(fp_emul_state_t, emul_work_area.result2_format);
        !           162: int _dword_frac1  = offsetof(fp_emul_state_t, emul_work_area.dword_frac1);
        !           163: int _sign1  = offsetof(fp_emul_state_t, emul_work_area.sign1);
        !           164: int _sign1_ext  = offsetof(fp_emul_state_t, emul_work_area.sign1_ext);
        !           165: int _tag1  = offsetof(fp_emul_state_t, emul_work_area.tag1);
        !           166: int _tag1_ext  = offsetof(fp_emul_state_t, emul_work_area.tag1_ext);
        !           167: int _expon1  = offsetof(fp_emul_state_t, emul_work_area.expon1);
        !           168: int _expon1_ext  = offsetof(fp_emul_state_t, emul_work_area.expon1_ext);
        !           169: int _dword_frac2  = offsetof(fp_emul_state_t, emul_work_area.dword_frac2);
        !           170: int _sign2  = offsetof(fp_emul_state_t, emul_work_area.sign2);
        !           171: int _sign2_ext  = offsetof(fp_emul_state_t, emul_work_area.sign2_ext);
        !           172: int _tag2  = offsetof(fp_emul_state_t, emul_work_area.tag2);
        !           173: int _tag2_ext  = offsetof(fp_emul_state_t, emul_work_area.tag2_ext);
        !           174: int _expon2  = offsetof(fp_emul_state_t, emul_work_area.expon2);
        !           175: int _expon2_ext  = offsetof(fp_emul_state_t, emul_work_area.expon2_ext);
        !           176: int _before_error_signals  = offsetof(fp_emul_state_t, emul_work_area.before_error_signals);
        !           177: int _extra_dword_reg  = offsetof(fp_emul_state_t, emul_work_area.extra_dword_reg);
        !           178: int _result_dword_frac  = offsetof(fp_emul_state_t, emul_work_area.result_dword_frac);
        !           179: int _result_sign  = offsetof(fp_emul_state_t, emul_work_area.result_sign);
        !           180: int _result_sign_ext  = offsetof(fp_emul_state_t, emul_work_area.result_sign_ext);
        !           181: int _result_tag  = offsetof(fp_emul_state_t, emul_work_area.result_tag);
        !           182: int _result_tag_ext  = offsetof(fp_emul_state_t, emul_work_area.result_tag_ext);
        !           183: int _result_expon  = offsetof(fp_emul_state_t, emul_work_area.result_expon);
        !           184: int _result_expon_ext  = offsetof(fp_emul_state_t, emul_work_area.result_expon_ext);
        !           185: int _result2_dword_frac  = offsetof(fp_emul_state_t, emul_work_area.result2_dword_frac);
        !           186: int _result2_sign  = offsetof(fp_emul_state_t, emul_work_area.result2_sign);
        !           187: int _result2_sign_ext  = offsetof(fp_emul_state_t, emul_work_area.result2_sign_ext);
        !           188: int _result2_tag  = offsetof(fp_emul_state_t, emul_work_area.result2_tag);
        !           189: int _result2_tag_ext  = offsetof(fp_emul_state_t, emul_work_area.result2_tag_ext);
        !           190: int _result2_expon  = offsetof(fp_emul_state_t, emul_work_area.result2_expon);
        !           191: int _result2_expon_ext  = offsetof(fp_emul_state_t, emul_work_area.result2_expon_ext);
        !           192: int _dword_cop  = offsetof(fp_emul_state_t, emul_work_area.dword_cop);
        !           193: int _dword_dop  = offsetof(fp_emul_state_t, emul_work_area.dword_dop);
        !           194: int _oprnd_siz32  = offsetof(fp_emul_state_t, emul_work_area.oprnd_siz32);
        !           195: int _addrs_siz32  = offsetof(fp_emul_state_t, emul_work_area.addrs_siz32);
        !           196: int _fpstate_ptr  = offsetof(fp_emul_state_t, emul_work_area.fpstate_ptr);
        !           197: int _is16bit  = offsetof(fp_emul_state_t, emul_work_area.is16bit);
        !           198: int _inst_counter  = offsetof(fp_emul_state_t, emul_work_area.inst_counter);
        !           199: int _trapno  = offsetof(fp_emul_state_t, trapno);
        !           200: 
        !           201: int _saved_gs  = offsetof(fp_emul_state_t, emul_regs.gs);
        !           202: int _saved_fs  = offsetof(fp_emul_state_t, emul_regs.fs);
        !           203: int _saved_es  = offsetof(fp_emul_state_t, emul_regs.es);
        !           204: int _saved_ds  = offsetof(fp_emul_state_t, emul_regs.ds);
        !           205: int _saved_edi  = offsetof(fp_emul_state_t, emul_regs.edi);
        !           206: int _saved_esi  = offsetof(fp_emul_state_t, emul_regs.esi);
        !           207: int _saved_ebp  = offsetof(fp_emul_state_t, emul_regs.ebp);
        !           208: int _saved_ebx  = offsetof(fp_emul_state_t, emul_regs.ebx);
        !           209: int _saved_edx  = offsetof(fp_emul_state_t, emul_regs.edx);
        !           210: int _saved_ecx  = offsetof(fp_emul_state_t, emul_regs.ecx);
        !           211: int _saved_eax  = offsetof(fp_emul_state_t, emul_regs.eax);
        !           212: 
        !           213: int _saved_eip  = offsetof(fp_emul_state_t, emul_frame.eip);
        !           214: int _saved_cs  = offsetof(fp_emul_state_t, emul_frame.cs);
        !           215: int _saved_flags  = offsetof(fp_emul_state_t, emul_frame.eflags);
        !           216: int _old_esp  = offsetof(fp_emul_state_t, emul_frame.esp);
        !           217: int _old_ss  = offsetof(fp_emul_state_t, emul_frame.ss);
        !           218: 
        !           219: int _WORK_AREA_SIZE  =sizeof(fp_emul_work_t);
        !           220: int _WORK_AREA_WORDS  =sizeof(fp_emul_work_t)/4;
        !           221: 
        !           222: #endif FP_EMUL
        !           223: 

unix.superglobalmegacorp.com

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