]> git.saurik.com Git - apple/xnu.git/blame - osfmk/kern/misc_protos.h
xnu-792.6.22.tar.gz
[apple/xnu.git] / osfmk / kern / misc_protos.h
CommitLineData
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 */
39extern void setbit(
40 int which,
41 int *bitmap);
42
43/* Clear a bit in a bit array */
44extern void clrbit(
45 int which,
46 int *bitmap);
47
48/* Find the first set bit in a bit array */
49extern int ffsbit(
50 int *bitmap);
51extern int ffs(
52 unsigned int mask);
53
54/*
55 * Test if indicated bit is set in bit string.
56 */
57extern int testbit(
58 int which,
59 int *bitmap);
60
1c79356b 61/* Move arbitrarily-aligned data from a user space to kernel space */
91447636
A
62extern 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
68extern 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
75extern 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
81extern 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
87extern int copyoutmsg(
88 const char *kernel_addr,
89 user_addr_t user_addr,
1c79356b
A
90 mach_msg_size_t nbytes);
91
92extern int sscanf(const char *input, const char *fmt, ...);
93
94extern integer_t sprintf(char *buf, const char *fmt, ...);
95
96extern void printf(const char *format, ...);
97
55e303ae
A
98extern void dbugprintf(const char *format, ...);
99
9bccf70c
A
100extern void kdp_printf(const char *format, ...);
101
1c79356b
A
102extern void printf_init(void);
103
1c79356b
A
104extern void log(int level, char *fmt, ...);
105
106void
107_doprnt(
108 register const char *fmt,
109 va_list *argp,
110 void (*putc)(char),
111 int radix);
9bccf70c
A
112int
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
120extern void safe_gets(
121 char *str,
122 int maxlen);
123
124extern void cnputcusr(char);
125
9bccf70c
A
126extern void conslog_putc(char);
127
128extern void consdebug_putc(char);
129
1c79356b
A
130extern void cnputc(char);
131
132extern int cngetc(void);
133
134extern int cnmaygetc(void);
135
136extern int _setjmp(
137 jmp_buf_t *jmp_buf);
138
139extern int _longjmp(
140 jmp_buf_t *jmp_buf,
141 int value);
142
143extern void bootstrap_create(void);
144
1c79356b
A
145extern void Debugger(
146 const char * message);
147
148extern void delay(
149 int n);
150
1c79356b
A
151
152extern void norma_bootstrap(void);
153
154#if DIPC
155extern boolean_t no_bootstrap_task(void);
156extern ipc_port_t get_root_master_device_port(void);
157#endif /* DIPC */
158
55e303ae
A
159extern 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_ */