Skip to content

Commit

Permalink
[SOL] Revert "Update syscalls num (#97)" (#100)
Browse files Browse the repository at this point in the history
* Revert "[SOL] Update syscalls num (#97)"

This reverts commit 0ee1d04.

* Re-add comment
  • Loading branch information
LucasSte authored Jan 24, 2025
1 parent 750aa39 commit 73c82a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/sbf/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ extern "C" {
#[cfg(target_feature = "static-syscalls")]
fn sol_alloc_free_(size: u64, ptr: u64) -> *mut u8 {
let syscall: extern "C" fn(u64, u64) -> *mut u8 =
unsafe { core::mem::transmute(11usize) }; // 11 is the code for "sol_alloc_free_"
unsafe { core::mem::transmute(2213547663u64) }; // murmur32 hash of "sol_alloc_free_"
syscall(size, ptr)
}
4 changes: 2 additions & 2 deletions library/std/src/sys/pal/sbf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ extern "C" {

#[cfg(target_feature = "static-syscalls")]
unsafe extern "C" fn abort() -> ! {
let syscall: extern "C" fn() -> ! = core::mem::transmute(1usize); // 1 is the code for "abort"
let syscall: extern "C" fn() -> ! = core::mem::transmute(3069975057u64); // murmur32 hash of "abort"
syscall()
}

#[cfg(target_feature = "static-syscalls")]
unsafe extern "C" fn sol_log_(message: *const u8, length: u64) {
let syscall: extern "C" fn(*const u8, u64) = core::mem::transmute(7usize); // 7 is the code for "sol_log_"
let syscall: extern "C" fn(*const u8, u64) = core::mem::transmute(544561597u64); // murmur32 hash of "sol_log_"
syscall(message, length)
}

Expand Down

0 comments on commit 73c82a6

Please sign in to comment.