summaryrefslogtreecommitdiff
path: root/src/stage4/lib
diff options
context:
space:
mode:
authorspv420 <spv@spv.sh>2022-08-01 13:45:45 -0400
committerspv420 <spv@spv.sh>2022-08-01 13:45:45 -0400
commit7a206940e14b0d269744bd598be075e33ef19aea (patch)
treebc257982f7ee4e291a183aa4153268974285eecd /src/stage4/lib
parent5ed6a7bb64ecf24c6dd12506688b43d9f33b65d2 (diff)
fuck
Diffstat (limited to 'src/stage4/lib')
-rw-r--r--src/stage4/lib/native_ptr.js31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/stage4/lib/native_ptr.js b/src/stage4/lib/native_ptr.js
index 81ac562..1ae5456 100644
--- a/src/stage4/lib/native_ptr.js
+++ b/src/stage4/lib/native_ptr.js
@@ -271,8 +271,7 @@ function Request_r3_buf_to_obj(buf) {
return ret;
}
-/*
-function Request_r3_buf_to_obj(buf) {
+function Request_r3_obj_to_buf(obj) {
var ret = new Uint8Array(this.size);
var tmp = mach_msg_header_t_obj_to_buf(obj.Head);
var begin = 0;
@@ -292,16 +291,32 @@ function Request_r3_buf_to_obj(buf) {
ret[i] = tmp[i - begin];
}
- var tmp = mach_msg_ool_ports_descriptor_t_obj_to_buf(obj.init_port_set[i]);
+ var tmp = mach_msg_ool_ports_descriptor_t_obj_to_buf(obj.init_port_set);
+
+ begin = i;
+
+ for (; i < 40; i++) {
+ ret[i] = tmp[i - begin];
+ }
+
+ var tmp = buf_ret(obj.NDR);
begin = i;
- for (; i < 36; i++) {
+ for (; i < 48; i++) {
ret[i] = tmp[i - begin];
}
+ var tmp = u32_to_u8x4(obj.init_port_setCnt);
-}*/
+ begin = i;
+
+ for (; i < 52; i++) {
+ ret[i] = tmp[i - begin];
+ }
+
+ return ret;
+}
function buf_ret(buf) {
return buf;
@@ -333,7 +348,11 @@ var mach_msg_type_number_t = uint32_t;
var Request_r3 = native_ptr_type(24 + 4 + 12 + 8 + 4,
Request_r3_buf_to_obj,
- buf_ret);
+ Request_r3_obj_to_buf);
+
+/*var Reply_r3 = native_ptr_type(24 + 4 + 12 + 8 + 4,
+ Reply_r3_buf_to_obj,
+ Reply_r3_obj_to_buf);*/
var mach_msg_trailer_type_t = uint32_t;
var mach_msg_trailer_size_t = uint32_t; \ No newline at end of file