Annotation of kernel/mach/i386/vm_param.h, revision 1.1.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:  * Copyright (c) 1992 NeXT Computer, Inc.
                     27:  *
                     28:  * Intel386 Family:    Virtual memory constants.
                     29:  *
                     30:  * HISTORY
                     31:  *
                     32:  * 14 April 1992 ? at NeXT
                     33:  *     Created.
                     34:  */
                     35: 
                     36: #ifndef        _MACH_I386_VM_PARAM_H_
                     37: #define _MACH_I386_VM_PARAM_H_
                     38: 
                     39: #import <sys/types.h>
                     40: 
                     41: #define BYTE_SIZE      8       /* byte size in bits */
                     42: #define BYTE_MSF       0
                     43: 
                     44: #define I386_PGBYTES   4096    /* bytes per 80386 page */
                     45: #define I386_PGSHIFT   12      /* number of bits to shift for pages */
                     46: 
                     47: /*
                     48:  *     Convert bytes to pages and convert pages to bytes.
                     49:  *     No rounding is used.
                     50:  */
                     51: 
                     52: #define i386_btop(x)           (((unsigned)(x)) >> I386_PGSHIFT)
                     53: #define i386_ptob(x)           (((unsigned)(x)) << I386_PGSHIFT)
                     54: 
                     55: /*
                     56:  *     Round off or truncate to the nearest page.  These will work
                     57:  *     for either addresses or counts.  (i.e. 1 byte rounds to 1 page
                     58:  *     bytes.
                     59:  */
                     60: 
                     61: #define i386_round_page(x)     ((((unsigned)(x)) + I386_PGBYTES - 1) & \
                     62:                                        ~(I386_PGBYTES-1))
                     63: #define i386_trunc_page(x)     (((unsigned)(x)) & ~(I386_PGBYTES-1))
                     64: 
                     65: #define VM_MIN_ADDRESS         ((vm_offset_t) 0)
                     66: #define VM_MAX_ADDRESS         ((vm_offset_t) 0xc0000000)
                     67: 
                     68: #define VM_MIN_KERNEL_ADDRESS  ((vm_offset_t) 0x00000000)
                     69: #define VM_MAX_KERNEL_ADDRESS  ((vm_offset_t) 0x40000000)
                     70: 
                     71: #define KERNSTACK_SIZE         (2*I386_PGBYTES)
                     72: #define INTSTACK_SIZE          (1*I386_PGBYTES)
                     73: 
                     74: /*
                     75:  *     Conversion between 80386 pages and VM pages
                     76:  */
                     77: 
                     78: #define trunc_i386_to_vm(p)    (atop(trunc_page(i386_ptob(p))))
                     79: #define round_i386_to_vm(p)    (atop(round_page(i386_ptob(p))))
                     80: #define vm_to_i386(p)          (i386_btop(ptoa(p)))
                     81: 
                     82: /*
                     83:  * Maximum alignment required by any data type for this architecture.
                     84:  * (Use 4 bytes for performance reasons....)
                     85:  */
                     86: #define        MAX_DATA_ALIGNMENT      4               /* 4 bytes */
                     87: 
                     88: #endif /* _MACH_I386_VM_PARAM_H_ */
                     89: 

unix.superglobalmegacorp.com

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