Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the signal constants and proc_raise function. #278

Merged
merged 3 commits into from
Mar 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion expected/wasm32-wasi/defined-symbols.txt
Original file line number Diff line number Diff line change
@@ -298,7 +298,6 @@ __wasi_path_symlink
__wasi_path_unlink_file
__wasi_poll_oneoff
__wasi_proc_exit
__wasi_proc_raise
__wasi_random_get
__wasi_sched_yield
__wasi_sock_recv
31 changes: 0 additions & 31 deletions expected/wasm32-wasi/predefined-macros.txt
Original file line number Diff line number Diff line change
@@ -2956,37 +2956,6 @@
#define __WASI_ROFLAGS_RECV_DATA_TRUNCATED ((__wasi_roflags_t)(1 << 0))
#define __WASI_SDFLAGS_RD ((__wasi_sdflags_t)(1 << 0))
#define __WASI_SDFLAGS_WR ((__wasi_sdflags_t)(1 << 1))
#define __WASI_SIGNAL_ABRT (UINT8_C(6))
#define __WASI_SIGNAL_ALRM (UINT8_C(14))
#define __WASI_SIGNAL_BUS (UINT8_C(7))
#define __WASI_SIGNAL_CHLD (UINT8_C(16))
#define __WASI_SIGNAL_CONT (UINT8_C(17))
#define __WASI_SIGNAL_FPE (UINT8_C(8))
#define __WASI_SIGNAL_HUP (UINT8_C(1))
#define __WASI_SIGNAL_ILL (UINT8_C(4))
#define __WASI_SIGNAL_INT (UINT8_C(2))
#define __WASI_SIGNAL_KILL (UINT8_C(9))
#define __WASI_SIGNAL_NONE (UINT8_C(0))
#define __WASI_SIGNAL_PIPE (UINT8_C(13))
#define __WASI_SIGNAL_POLL (UINT8_C(28))
#define __WASI_SIGNAL_PROF (UINT8_C(26))
#define __WASI_SIGNAL_PWR (UINT8_C(29))
#define __WASI_SIGNAL_QUIT (UINT8_C(3))
#define __WASI_SIGNAL_SEGV (UINT8_C(11))
#define __WASI_SIGNAL_STOP (UINT8_C(18))
#define __WASI_SIGNAL_SYS (UINT8_C(30))
#define __WASI_SIGNAL_TERM (UINT8_C(15))
#define __WASI_SIGNAL_TRAP (UINT8_C(5))
#define __WASI_SIGNAL_TSTP (UINT8_C(19))
#define __WASI_SIGNAL_TTIN (UINT8_C(20))
#define __WASI_SIGNAL_TTOU (UINT8_C(21))
#define __WASI_SIGNAL_URG (UINT8_C(22))
#define __WASI_SIGNAL_USR1 (UINT8_C(10))
#define __WASI_SIGNAL_USR2 (UINT8_C(12))
#define __WASI_SIGNAL_VTALRM (UINT8_C(25))
#define __WASI_SIGNAL_WINCH (UINT8_C(27))
#define __WASI_SIGNAL_XCPU (UINT8_C(23))
#define __WASI_SIGNAL_XFSZ (UINT8_C(24))
#define __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME ((__wasi_subclockflags_t)(1 << 0))
#define __WASI_WHENCE_CUR (UINT8_C(1))
#define __WASI_WHENCE_END (UINT8_C(2))
1 change: 0 additions & 1 deletion expected/wasm32-wasi/undefined-symbols.txt
Original file line number Diff line number Diff line change
@@ -50,7 +50,6 @@ __imported_wasi_snapshot_preview1_path_symlink
__imported_wasi_snapshot_preview1_path_unlink_file
__imported_wasi_snapshot_preview1_poll_oneoff
__imported_wasi_snapshot_preview1_proc_exit
__imported_wasi_snapshot_preview1_proc_raise
__imported_wasi_snapshot_preview1_random_get
__imported_wasi_snapshot_preview1_sched_yield
__imported_wasi_snapshot_preview1_sock_recv
204 changes: 0 additions & 204 deletions libc-bottom-half/headers/public/wasi/api.h
Original file line number Diff line number Diff line change
@@ -1300,200 +1300,6 @@ typedef uint32_t __wasi_exitcode_t;
_Static_assert(sizeof(__wasi_exitcode_t) == 4, "witx calculated size");
_Static_assert(_Alignof(__wasi_exitcode_t) == 4, "witx calculated align");

/**
* Signal condition.
*/
typedef uint8_t __wasi_signal_t;

/**
* No signal. Note that POSIX has special semantics for `kill(pid, 0)`,
* so this value is reserved.
*/
#define __WASI_SIGNAL_NONE (UINT8_C(0))

/**
* Hangup.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_HUP (UINT8_C(1))

/**
* Terminate interrupt signal.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_INT (UINT8_C(2))

/**
* Terminal quit signal.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_QUIT (UINT8_C(3))

/**
* Illegal instruction.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_ILL (UINT8_C(4))

/**
* Trace/breakpoint trap.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_TRAP (UINT8_C(5))

/**
* Process abort signal.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_ABRT (UINT8_C(6))

/**
* Access to an undefined portion of a memory object.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_BUS (UINT8_C(7))

/**
* Erroneous arithmetic operation.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_FPE (UINT8_C(8))

/**
* Kill.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_KILL (UINT8_C(9))

/**
* User-defined signal 1.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_USR1 (UINT8_C(10))

/**
* Invalid memory reference.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_SEGV (UINT8_C(11))

/**
* User-defined signal 2.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_USR2 (UINT8_C(12))

/**
* Write on a pipe with no one to read it.
* Action: Ignored.
*/
#define __WASI_SIGNAL_PIPE (UINT8_C(13))

/**
* Alarm clock.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_ALRM (UINT8_C(14))

/**
* Termination signal.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_TERM (UINT8_C(15))

/**
* Child process terminated, stopped, or continued.
* Action: Ignored.
*/
#define __WASI_SIGNAL_CHLD (UINT8_C(16))

/**
* Continue executing, if stopped.
* Action: Continues executing, if stopped.
*/
#define __WASI_SIGNAL_CONT (UINT8_C(17))

/**
* Stop executing.
* Action: Stops executing.
*/
#define __WASI_SIGNAL_STOP (UINT8_C(18))

/**
* Terminal stop signal.
* Action: Stops executing.
*/
#define __WASI_SIGNAL_TSTP (UINT8_C(19))

/**
* Background process attempting read.
* Action: Stops executing.
*/
#define __WASI_SIGNAL_TTIN (UINT8_C(20))

/**
* Background process attempting write.
* Action: Stops executing.
*/
#define __WASI_SIGNAL_TTOU (UINT8_C(21))

/**
* High bandwidth data is available at a socket.
* Action: Ignored.
*/
#define __WASI_SIGNAL_URG (UINT8_C(22))

/**
* CPU time limit exceeded.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_XCPU (UINT8_C(23))

/**
* File size limit exceeded.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_XFSZ (UINT8_C(24))

/**
* Virtual timer expired.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_VTALRM (UINT8_C(25))

/**
* Profiling timer expired.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_PROF (UINT8_C(26))

/**
* Window changed.
* Action: Ignored.
*/
#define __WASI_SIGNAL_WINCH (UINT8_C(27))

/**
* I/O possible.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_POLL (UINT8_C(28))

/**
* Power failure.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_PWR (UINT8_C(29))

/**
* Bad system call.
* Action: Terminates the process.
*/
#define __WASI_SIGNAL_SYS (UINT8_C(30))

_Static_assert(sizeof(__wasi_signal_t) == 1, "witx calculated size");
_Static_assert(_Alignof(__wasi_signal_t) == 1, "witx calculated align");

/**
* Flags provided to `sock_recv`.
*/
@@ -2181,16 +1987,6 @@ _Noreturn void __wasi_proc_exit(
*/
__wasi_exitcode_t rval
);
/**
* Send a signal to the process of the calling thread.
* Note: This is similar to `raise` in POSIX.
*/
__wasi_errno_t __wasi_proc_raise(
/**
* The signal condition to trigger.
*/
__wasi_signal_t sig
) __attribute__((__warn_unused_result__));
/**
* Temporarily yield execution of the calling thread.
* Note: This is similar to `sched_yield` in POSIX.
12 changes: 0 additions & 12 deletions libc-bottom-half/sources/__wasilibc_real.c
Original file line number Diff line number Diff line change
@@ -574,18 +574,6 @@ _Noreturn void __wasi_proc_exit(
__imported_wasi_snapshot_preview1_proc_exit((int32_t) rval);
}

int32_t __imported_wasi_snapshot_preview1_proc_raise(int32_t arg0) __attribute__((
__import_module__("wasi_snapshot_preview1"),
__import_name__("proc_raise")
));

__wasi_errno_t __wasi_proc_raise(
__wasi_signal_t sig
){
int32_t ret = __imported_wasi_snapshot_preview1_proc_raise((int32_t) sig);
return (uint16_t) ret;
}

int32_t __imported_wasi_snapshot_preview1_sched_yield() __attribute__((
__import_module__("wasi_snapshot_preview1"),
__import_name__("sched_yield")