-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from gnzlbg/clock
Add clock, dyld_kernel, and exception types
- Loading branch information
Showing
19 changed files
with
556 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,73 @@ | ||
//! This module corresponds to `bootstrap.h` | ||
use boolean::boolean_t; | ||
use kern_return::{kern_return_t}; | ||
use libc; | ||
use port::{mach_port_t}; | ||
|
||
pub const BOOTSTRAP_MAX_NAME_LEN: libc::c_uint = 128; | ||
pub const BOOTSTRAP_MAX_NAME_LEN: ::libc::c_uint = 128; | ||
pub const BOOTSTRAP_MAX_CMD_LEN: ::libc::c_uint = 512; | ||
|
||
pub const BOOTSTRAP_MAX_LOOKUP_COUNT: ::libc::c_uint = 20; | ||
|
||
pub const BOOTSTRAP_SUCCESS: ::libc::c_uint = 0; | ||
pub const BOOTSTRAP_NOT_PRIVILEGED: ::libc::c_uint = 1100; | ||
pub const BOOTSTRAP_NAME_IN_USE: ::libc::c_uint = 1101; | ||
pub const BOOTSTRAP_UNKNOWN_SERVICE: ::libc::c_uint = 1102; | ||
pub const BOOTSTRAP_SERVICE_ACTIVE: ::libc::c_uint = 1103; | ||
pub const BOOTSTRAP_BAD_COUNT: ::libc::c_uint = 1104; | ||
pub const BOOTSTRAP_NO_MEMORY: ::libc::c_uint = 1105; | ||
pub const BOOTSTRAP_NO_CHILDREN: ::libc::c_uint = 1106; | ||
|
||
pub const BOOTSTRAP_STATUS_INACTIVE: ::libc::c_uint = 0; | ||
pub const BOOTSTRAP_STATUS_ACTIVE: ::libc::c_uint = 1; | ||
pub const BOOTSTRAP_STATUS_ON_DEMAND: ::libc::c_uint = 2; | ||
|
||
pub type name_t = [::libc::c_char; 128]; | ||
pub type cmd_t = [::libc::c_char; 512]; | ||
pub type name_array_t = *mut name_t; | ||
pub type bootstrap_status_t = ::libc::c_int; | ||
pub type bootstrap_status_array_t = *mut bootstrap_status_t; | ||
pub type bootstrap_property_t = ::libc::c_uint; | ||
pub type bootstrap_property_array_t = *mut bootstrap_property_t; | ||
pub type bool_array_t = *mut boolean_t; | ||
|
||
extern "C" { | ||
pub static bootstrap_port: mach_port_t; | ||
pub fn bootstrap_create_server(bp: mach_port_t, | ||
server_cmd: *mut ::libc::c_char, | ||
server_uid: ::libc::uid_t, | ||
on_demand: boolean_t, | ||
server_port: *mut mach_port_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_subset(bp: mach_port_t, | ||
requestor_port: mach_port_t, | ||
subset_port: *mut mach_port_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_unprivileged(bp: mach_port_t, | ||
unpriv_port: *mut mach_port_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_parent(bp: mach_port_t, | ||
parent_port: *mut mach_port_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_register(bp: mach_port_t, | ||
service_name: *mut ::libc::c_char, | ||
sp: mach_port_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_create_service(bp: mach_port_t, | ||
service_name: *mut ::libc::c_char, | ||
sp: *mut mach_port_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_check_in(bp: mach_port_t, | ||
service_name: *const ::libc::c_char, | ||
sp: *mut mach_port_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_look_up(bp: mach_port_t, | ||
service_name: *const libc::c_char, | ||
service_name: *const ::libc::c_char, | ||
sp: *mut mach_port_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_status(bp: mach_port_t, | ||
service_name: *mut ::libc::c_char, | ||
service_active: *mut bootstrap_status_t) | ||
-> kern_return_t; | ||
pub fn bootstrap_strerror(r: kern_return_t) -> *const ::libc::c_char; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//! This module roughly corresponds to `mach/clock.h`. | ||
pub const clock_MSG_COUNT: ::libc::c_uint = 3; | ||
|
||
use mach_types::{clock_serv_t, clock_reply_t}; | ||
use clock_types::{mach_timespec_t, clock_flavor_t, clock_attr_t, alarm_type_t}; | ||
use kern_return::kern_return_t; | ||
use message::mach_msg_type_number_t; | ||
|
||
extern "C" { | ||
pub fn clock_get_time(clock_serv: clock_serv_t, | ||
cur_time: *mut mach_timespec_t) | ||
-> kern_return_t; | ||
pub fn clock_get_attributes(clock_serv: clock_serv_t, | ||
flavor: clock_flavor_t, | ||
clock_attr: clock_attr_t, | ||
clock_attrCnt: *mut mach_msg_type_number_t) | ||
-> kern_return_t; | ||
pub fn clock_alarm(clock_serv: clock_serv_t, | ||
alarm_type: alarm_type_t, | ||
alarm_time: mach_timespec_t, | ||
alarm_port: clock_reply_t) | ||
-> kern_return_t; | ||
} |
Oops, something went wrong.