]>
Commit | Line | Data |
---|---|---|
e9ce8d39 A |
1 | /* |
2 | * @OSF_COPYRIGHT@ | |
3 | */ | |
4 | ||
5 | /* | |
6 | * Define a service to map from a kernel-generated port name | |
7 | * to server-defined "type" and "value" data to be associated | |
8 | * with the port. | |
9 | */ | |
10 | #include <mach/port_obj.h> | |
11 | #include <mach/mach.h> | |
12 | ||
13 | #define DEFAULT_TABLE_SIZE (64 * 1024) | |
14 | ||
15 | struct port_obj_tentry *port_obj_table; | |
16 | int port_obj_table_size = DEFAULT_TABLE_SIZE; | |
17 | ||
18 | void port_obj_init( | |
19 | int maxsize) | |
20 | { | |
21 | kern_return_t kr; | |
22 | ||
23 | kr = vm_allocate(mach_task_self(), | |
24 | (vm_offset_t *)&port_obj_table, | |
25 | (vm_size_t)(maxsize * sizeof (*port_obj_table)), | |
26 | TRUE); | |
27 | if (kr != KERN_SUCCESS) | |
28 | panic("port_obj_init: can't vm_allocate"); | |
29 | } |