@@ -15,20 +15,13 @@ use io;
15
15
use os:: raw:: c_char;
16
16
use u64;
17
17
18
- use libc:: { c_int, c_void} ;
18
+ use libc:: { c_int, c_void, size_t } ;
19
19
20
20
pub type zx_handle_t = u32 ;
21
21
pub type zx_vaddr_t = usize ;
22
22
pub type zx_rights_t = u32 ;
23
23
pub type zx_status_t = i32 ;
24
24
25
- // TODO(raggi): zx_size_t was removed from Zircon. various syscall API docs use size_t here, but
26
- // don't define that well at the ABI level yet, as the C spec definition of size_t isn't what is
27
- // meant. In the future Zirocn will define size_t more strictly for it's ABI. At that time,
28
- // zx_size_t should be removed here, and replaced with an appropriately sized type with a
29
- // sufficiently strict definition.
30
- pub type zx_size_t = usize ;
31
-
32
25
pub const ZX_HANDLE_INVALID : zx_handle_t = 0 ;
33
26
34
27
pub type zx_time_t = u64 ;
@@ -120,36 +113,37 @@ extern {
120
113
pending : * mut zx_signals_t ) -> zx_status_t ;
121
114
122
115
pub fn zx_object_get_info ( handle : zx_handle_t , topic : u32 , buffer : * mut c_void ,
123
- buffer_size : zx_size_t , actual_size : * mut zx_size_t ,
124
- avail : * mut zx_size_t ) -> zx_status_t ;
116
+ buffer_size : size_t , actual_size : * mut size_t ,
117
+ avail : * mut size_t ) -> zx_status_t ;
125
118
}
126
119
127
120
// From `enum special_handles` in system/ulib/launchpad/launchpad.c
128
121
// HND_LOADER_SVC = 0
129
122
// HND_EXEC_VMO = 1
130
- pub const HND_SPECIAL_COUNT : usize = 2 ;
123
+ // HND_SEGMENTS_VMAR = 2
124
+ const HND_SPECIAL_COUNT : c_int = 3 ;
131
125
132
126
#[ repr( C ) ]
133
127
pub struct launchpad_t {
134
128
argc : u32 ,
135
129
envc : u32 ,
136
130
args : * const c_char ,
137
- args_len : usize ,
131
+ args_len : size_t ,
138
132
env : * const c_char ,
139
- env_len : usize ,
133
+ env_len : size_t ,
140
134
141
135
handles : * mut zx_handle_t ,
142
136
handles_info : * mut u32 ,
143
- handle_count : usize ,
144
- handle_alloc : usize ,
137
+ handle_count : size_t ,
138
+ handle_alloc : size_t ,
145
139
146
140
entry : zx_vaddr_t ,
147
141
base : zx_vaddr_t ,
148
142
vdso_base : zx_vaddr_t ,
149
143
150
- stack_size : usize ,
144
+ stack_size : size_t ,
151
145
152
- special_handles : [ zx_handle_t ; HND_SPECIAL_COUNT ] ,
146
+ special_handles : [ zx_handle_t ; HND_SPECIAL_COUNT as usize ] ,
153
147
loader_message : bool ,
154
148
}
155
149
0 commit comments