]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
91447636 | 2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. |
1c79356b A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
e5568f75 A |
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. | |
1c79356b | 11 | * |
e5568f75 A |
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 | |
1c79356b A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
e5568f75 A |
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. | |
1c79356b A |
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 <stdarg.h> | |
30 | #include <string.h> | |
31 | #include <machine/setjmp.h> | |
32 | #include <mach/boolean.h> | |
33 | #include <mach/message.h> | |
34 | #include <mach/machine/vm_types.h> | |
35 | #include <ipc/ipc_types.h> | |
91447636 | 36 | #include <kern/debug.h> |
1c79356b A |
37 | |
38 | /* Set a bit in a bit array */ | |
39 | extern void setbit( | |
40 | int which, | |
41 | int *bitmap); | |
42 | ||
43 | /* Clear a bit in a bit array */ | |
44 | extern void clrbit( | |
45 | int which, | |
46 | int *bitmap); | |
47 | ||
48 | /* Find the first set bit in a bit array */ | |
49 | extern int ffsbit( | |
50 | int *bitmap); | |
51 | extern int ffs( | |
52 | unsigned int mask); | |
53 | ||
54 | /* | |
55 | * Test if indicated bit is set in bit string. | |
56 | */ | |
57 | extern int testbit( | |
58 | int which, | |
59 | int *bitmap); | |
60 | ||
1c79356b | 61 | /* Move arbitrarily-aligned data from a user space to kernel space */ |
91447636 A |
62 | extern int copyin( |
63 | const user_addr_t user_addr, | |
64 | char *kernel_addr, | |
65 | vm_size_t nbytes); | |
1c79356b A |
66 | |
67 | /* Move a NUL-terminated string from a user space to kernel space */ | |
91447636 A |
68 | extern int copyinstr( |
69 | const user_addr_t user_addr, | |
70 | char *kernel_addr, | |
71 | vm_size_t max, | |
72 | vm_size_t *actual); | |
1c79356b A |
73 | |
74 | /* Move arbitrarily-aligned data from a user space to kernel space */ | |
91447636 A |
75 | extern int copyinmsg( |
76 | const user_addr_t user_addr, | |
77 | char *kernel_addr, | |
78 | mach_msg_size_t nbytes); | |
1c79356b A |
79 | |
80 | /* Move arbitrarily-aligned data from a kernel space to user space */ | |
91447636 A |
81 | extern int copyout( |
82 | const char *kernel_addr, | |
83 | user_addr_t user_addr, | |
84 | vm_size_t nbytes); | |
1c79356b A |
85 | |
86 | /* Move arbitrarily-aligned data from a kernel space to user space */ | |
91447636 A |
87 | extern int copyoutmsg( |
88 | const char *kernel_addr, | |
89 | user_addr_t user_addr, | |
1c79356b A |
90 | mach_msg_size_t nbytes); |
91 | ||
92 | extern int sscanf(const char *input, const char *fmt, ...); | |
93 | ||
94 | extern integer_t sprintf(char *buf, const char *fmt, ...); | |
95 | ||
96 | extern void printf(const char *format, ...); | |
97 | ||
55e303ae A |
98 | extern void dbugprintf(const char *format, ...); |
99 | ||
9bccf70c A |
100 | extern void kdp_printf(const char *format, ...); |
101 | ||
1c79356b A |
102 | extern void printf_init(void); |
103 | ||
1c79356b A |
104 | extern void log(int level, char *fmt, ...); |
105 | ||
106 | void | |
107 | _doprnt( | |
108 | register const char *fmt, | |
109 | va_list *argp, | |
110 | void (*putc)(char), | |
111 | int radix); | |
9bccf70c A |
112 | int |
113 | __doprnt( | |
114 | register const char *fmt, | |
115 | va_list *argp, | |
116 | void (*putc)(int, void *), | |
117 | void *arg, | |
118 | int radix); | |
1c79356b A |
119 | |
120 | extern void safe_gets( | |
121 | char *str, | |
122 | int maxlen); | |
123 | ||
124 | extern void cnputcusr(char); | |
125 | ||
9bccf70c A |
126 | extern void conslog_putc(char); |
127 | ||
128 | extern void consdebug_putc(char); | |
129 | ||
1c79356b A |
130 | extern void cnputc(char); |
131 | ||
132 | extern int cngetc(void); | |
133 | ||
134 | extern int cnmaygetc(void); | |
135 | ||
136 | extern int _setjmp( | |
137 | jmp_buf_t *jmp_buf); | |
138 | ||
139 | extern int _longjmp( | |
140 | jmp_buf_t *jmp_buf, | |
141 | int value); | |
142 | ||
143 | extern void bootstrap_create(void); | |
144 | ||
1c79356b A |
145 | extern void Debugger( |
146 | const char * message); | |
147 | ||
148 | extern void delay( | |
149 | int n); | |
150 | ||
1c79356b A |
151 | |
152 | extern void norma_bootstrap(void); | |
153 | ||
154 | #if DIPC | |
155 | extern boolean_t no_bootstrap_task(void); | |
156 | extern ipc_port_t get_root_master_device_port(void); | |
157 | #endif /* DIPC */ | |
158 | ||
55e303ae A |
159 | extern kern_return_t kernel_set_special_port( |
160 | host_priv_t host_priv, | |
161 | int which, | |
162 | ipc_port_t port); | |
163 | ||
1c79356b | 164 | #endif /* _MISC_PROTOS_H_ */ |