Annotation of XNU/osfmk/kern/misc_protos.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * The contents of this file constitute Original Code as defined in and
                      7:  * are subject to the Apple Public Source License Version 1.1 (the
                      8:  * "License").  You may not use this file except in compliance with the
                      9:  * License.  Please obtain a copy of the License at
                     10:  * http://www.apple.com/publicsource and read it before using this file.
                     11:  * 
                     12:  * This Original Code and all software distributed under the License are
                     13:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     14:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     15:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     16:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     17:  * License for the specific language governing rights and limitations
                     18:  * under the License.
                     19:  * 
                     20:  * @APPLE_LICENSE_HEADER_END@
                     21:  */
                     22: /*
                     23:  * @OSF_COPYRIGHT@
                     24:  */
                     25: 
                     26: #ifndef        _MISC_PROTOS_H_
                     27: #define        _MISC_PROTOS_H_
                     28: 
                     29: #include <dipc.h>
                     30: 
                     31: #include <stdarg.h>
                     32: #include <string.h>
                     33: #include <machine/setjmp.h>
                     34: #include <mach/boolean.h>
                     35: #include <mach/message.h>
                     36: #include <mach/machine/vm_types.h>
                     37: #include <ipc/ipc_types.h>
                     38: 
                     39: /* Set a bit in a bit array */
                     40: extern void setbit(
                     41:        int             which,
                     42:        int             *bitmap);
                     43: 
                     44: /* Clear a bit in a bit array */
                     45: extern void clrbit(
                     46:        int             which,
                     47:        int             *bitmap);
                     48: 
                     49: /* Find the first set bit in a bit array */
                     50: extern int ffsbit(
                     51:        int             *bitmap);
                     52: extern int ffs(
                     53:        unsigned int    mask);
                     54: 
                     55: /*
                     56:  * Test if indicated bit is set in bit string.
                     57:  */
                     58: extern int testbit(
                     59:        int             which,
                     60:        int             *bitmap);
                     61: 
                     62: /* Move arbitrarily-aligned data from one array to another */
                     63: extern void bcopy(
                     64:        const char      *from,
                     65:        char            *to,
                     66:        vm_size_t       nbytes);
                     67: 
                     68: /* Move overlapping, arbitrarily aligned data from one array to another */
                     69: /* Not present on all ports */
                     70: extern void ovbcopy(
                     71:        const char      *from,
                     72:        char            *to,
                     73:        vm_size_t       nbytes);
                     74: 
                     75: extern int bcmp(
                     76:                const char *a,
                     77:                const char *b,
                     78:                vm_size_t len);
                     79: 
                     80: /* Zero an arbitrarily aligned array */
                     81: extern void bzero(
                     82:        char    *from,
                     83:        vm_size_t       nbytes);
                     84: 
                     85: /* Move arbitrarily-aligned data from a user space to kernel space */
                     86: extern boolean_t copyin(
                     87:        const char      *user_addr,
                     88:        char            *kernel_addr,
                     89:        vm_size_t       nbytes);
                     90: 
                     91: /* Move a NUL-terminated string from a user space to kernel space */
                     92: extern boolean_t copyinstr(
                     93:        const char      *user_addr,
                     94:        char            *kernel_addr,
                     95:        vm_size_t       max,
                     96:        vm_size_t       *actual);
                     97: 
                     98: /* Move arbitrarily-aligned data from a user space to kernel space */
                     99: extern boolean_t copyinmsg(
                    100:        const char      *user_addr,
                    101:        char            *kernel_addr,
                    102:        mach_msg_size_t nbytes);
                    103: 
                    104: /* Move arbitrarily-aligned data from a kernel space to user space */
                    105: extern boolean_t copyout(
                    106:        const char      *kernel_addr,
                    107:        char            *user_addr,
                    108:        vm_size_t        nbytes);
                    109: 
                    110: /* Move arbitrarily-aligned data from a kernel space to user space */
                    111: extern boolean_t copyoutmsg(
                    112:        const char      *kernel_addr,
                    113:        char            *user_addr,
                    114:        mach_msg_size_t nbytes);
                    115: 
                    116: extern int sscanf(const char *input, const char *fmt, ...);
                    117: 
                    118: extern integer_t sprintf(char *buf, const char *fmt, ...);
                    119: 
                    120: extern void printf(const char *format, ...);
                    121: 
                    122: extern void printf_init(void);
                    123: 
                    124: extern void panic(const char *string, ...);
                    125: 
                    126: extern void panic_init(void);
                    127: 
                    128: extern void log(int level, char *fmt, ...);
                    129: 
                    130: void 
                    131: _doprnt(
                    132:        register const char     *fmt,
                    133:        va_list                 *argp,
                    134:        void                    (*putc)(char),
                    135:        int                     radix);
                    136: 
                    137: extern void safe_gets(
                    138:        char    *str,
                    139:        int     maxlen);
                    140: 
                    141: extern void cnputcusr(char);
                    142: 
                    143: extern void cnputc(char);
                    144: 
                    145: extern int cngetc(void);
                    146: 
                    147: extern int cnmaygetc(void);
                    148: 
                    149: extern int _setjmp(
                    150:        jmp_buf_t       *jmp_buf);
                    151: 
                    152: extern int _longjmp(
                    153:        jmp_buf_t       *jmp_buf,
                    154:        int             value);
                    155: 
                    156: extern void bootstrap_create(void);
                    157: 
                    158: extern void halt_cpu(void);
                    159: 
                    160: extern void halt_all_cpus(
                    161:                boolean_t       reboot);
                    162: 
                    163: extern void Debugger(
                    164:                const char      * message);
                    165: 
                    166: extern void delay(
                    167:                int             n);
                    168: 
                    169: extern char *machine_boot_info(
                    170:                char            *buf,
                    171:                vm_size_t       buf_len);
                    172: 
                    173: /*
                    174:  * Machine-dependent routine to fill in an array with up to callstack_max
                    175:  * levels of return pc information.
                    176:  */
                    177: extern void machine_callstack(
                    178:                natural_t       *buf,
                    179:                vm_size_t       callstack_max);
                    180: 
                    181: extern void consider_machine_collect(void);
                    182: 
                    183: extern void norma_bootstrap(void);
                    184: 
                    185: #if    DIPC
                    186: extern boolean_t       no_bootstrap_task(void);
                    187: extern ipc_port_t      get_root_master_device_port(void);
                    188: #endif /* DIPC */
                    189: 
                    190: #endif /* _MISC_PROTOS_H_ */

unix.superglobalmegacorp.com

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