| ... | @@ -28,7 +28,7 @@ pub const MailboxId = union(enum) { | ... | @@ -28,7 +28,7 @@ pub const MailboxId = union(enum) { |
| 28 | This, | 28 | This, |
| 29 | Kernel, | 29 | Kernel, |
| 30 | Port: u16, | 30 | Port: u16, |
| 31 | //Thread: u16, | 31 | Thread: u16, |
| 32 | }; | 32 | }; |
| 33 | | 33 | |
| 34 | | 34 | |
| ... | @@ -96,8 +96,11 @@ pub fn exit(status: i32) noreturn { | ... | @@ -96,8 +96,11 @@ pub fn exit(status: i32) noreturn { |
| 96 | unreachable; | 96 | unreachable; |
| 97 | } | 97 | } |
| 98 | | 98 | |
| 99 | pub fn createPort(id: u16) void { | 99 | pub fn createPort(mailbox_id: &const MailboxId) void { |
| 100 | _ = syscall1(Syscall.createPort, id); | 100 | _ = switch (*mailbox_id) { |
| | 101 | MailboxId.Port => |id| syscall1(Syscall.createPort, id), |
| | 102 | else => unreachable, |
| | 103 | }; |
| 101 | } | 104 | } |
| 102 | | 105 | |
| 103 | pub fn send(message: &const Message) void { | 106 | pub fn send(message: &const Message) void { |