aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/cloudabi
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2017-08-30 07:30:06 +0000
committerEd Schouten <ed@FreeBSD.org>2017-08-30 07:30:06 +0000
commitb53b978a6c4ee0681ccb6a797cae760c7ba0da64 (patch)
treee65940e93dfe0d1d7decd121282c35a5539ba42d /sys/contrib/cloudabi
parent2b12718be6bf382e36850a71bab54700bca69588 (diff)
downloadsrc-b53b978a6c4ee0681ccb6a797cae760c7ba0da64.tar.gz
src-b53b978a6c4ee0681ccb6a797cae760c7ba0da64.zip
Complete the CloudABI networking refactoring.
Now that all of the packaged software has been adjusted to either use Flower (https://github.com/NuxiNL/flower) for making incoming/outgoing network connections or can have connections injected, there is no longer need to keep accept() around. It is now a lot easier to write networked services that are address family independent, dual-stack, testable, etc. Remove all of the bits related to accept(), but also to getsockopt(SO_ACCEPTCONN).
Notes
Notes: svn path=/head/; revision=323015
Diffstat (limited to 'sys/contrib/cloudabi')
-rw-r--r--sys/contrib/cloudabi/cloudabi_types_common.h19
-rw-r--r--sys/contrib/cloudabi/cloudabi_vdso_aarch64.S30
-rw-r--r--sys/contrib/cloudabi/cloudabi_vdso_armv6.S28
-rw-r--r--sys/contrib/cloudabi/cloudabi_vdso_i686.S29
-rw-r--r--sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S52
-rw-r--r--sys/contrib/cloudabi/cloudabi_vdso_x86_64.S30
-rw-r--r--sys/contrib/cloudabi/syscalls32.master21
-rw-r--r--sys/contrib/cloudabi/syscalls64.master21
8 files changed, 42 insertions, 188 deletions
diff --git a/sys/contrib/cloudabi/cloudabi_types_common.h b/sys/contrib/cloudabi/cloudabi_types_common.h
index a5176d4df35c..2764e3697d84 100644
--- a/sys/contrib/cloudabi/cloudabi_types_common.h
+++ b/sys/contrib/cloudabi/cloudabi_types_common.h
@@ -282,9 +282,7 @@ typedef uint64_t cloudabi_rights_t;
#define CLOUDABI_RIGHT_POLL_PROC_TERMINATE 0x0000000040000000
#define CLOUDABI_RIGHT_POLL_WAIT 0x0000000080000000
#define CLOUDABI_RIGHT_PROC_EXEC 0x0000000100000000
-#define CLOUDABI_RIGHT_SOCK_ACCEPT 0x0000000200000000
#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000
-#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000
typedef uint16_t cloudabi_roflags_t;
#define CLOUDABI_SOCK_RECV_FDS_TRUNCATED 0x0001
@@ -328,12 +326,6 @@ typedef uint8_t cloudabi_signal_t;
#define CLOUDABI_SIGXCPU 25
#define CLOUDABI_SIGXFSZ 26
-typedef uint8_t cloudabi_ssflags_t;
-#define CLOUDABI_SOCKSTAT_CLEAR_ERROR 0x01
-
-typedef uint32_t cloudabi_sstate_t;
-#define CLOUDABI_SOCKSTATE_ACCEPTCONN 0x00000001
-
typedef uint16_t cloudabi_subclockflags_t;
#define CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME 0x0001
@@ -418,15 +410,4 @@ _Static_assert(offsetof(cloudabi_lookup_t, flags) == 4, "Incorrect layout");
_Static_assert(sizeof(cloudabi_lookup_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_lookup_t) == 4, "Incorrect layout");
-typedef struct {
- _Alignas(1) char ss_unused[40];
- _Alignas(2) cloudabi_errno_t ss_error;
- _Alignas(4) cloudabi_sstate_t ss_state;
-} cloudabi_sockstat_t;
-_Static_assert(offsetof(cloudabi_sockstat_t, ss_unused) == 0, "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockstat_t, ss_error) == 40, "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockstat_t, ss_state) == 44, "Incorrect layout");
-_Static_assert(sizeof(cloudabi_sockstat_t) == 48, "Incorrect layout");
-_Static_assert(_Alignof(cloudabi_sockstat_t) == 4, "Incorrect layout");
-
#endif
diff --git a/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S b/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S
index 8564dfd74f76..7c98e5b3f005 100644
--- a/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S
+++ b/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S
@@ -401,45 +401,27 @@ ENTRY(cloudabi_sys_random_get)
ret
END(cloudabi_sys_random_get)
-ENTRY(cloudabi_sys_sock_accept)
- str x2, [sp, #-8]
- mov w8, #44
- svc #0
- ldr x2, [sp, #-8]
- b.cs 1f
- str w0, [x2]
- mov w0, wzr
-1:
- ret
-END(cloudabi_sys_sock_accept)
-
ENTRY(cloudabi_sys_sock_recv)
- mov w8, #45
+ mov w8, #44
svc #0
ret
END(cloudabi_sys_sock_recv)
ENTRY(cloudabi_sys_sock_send)
- mov w8, #46
+ mov w8, #45
svc #0
ret
END(cloudabi_sys_sock_send)
ENTRY(cloudabi_sys_sock_shutdown)
- mov w8, #47
+ mov w8, #46
svc #0
ret
END(cloudabi_sys_sock_shutdown)
-ENTRY(cloudabi_sys_sock_stat_get)
- mov w8, #48
- svc #0
- ret
-END(cloudabi_sys_sock_stat_get)
-
ENTRY(cloudabi_sys_thread_create)
str x1, [sp, #-8]
- mov w8, #49
+ mov w8, #47
svc #0
ldr x2, [sp, #-8]
b.cs 1f
@@ -450,12 +432,12 @@ ENTRY(cloudabi_sys_thread_create)
END(cloudabi_sys_thread_create)
ENTRY(cloudabi_sys_thread_exit)
- mov w8, #50
+ mov w8, #48
svc #0
END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
- mov w8, #51
+ mov w8, #49
svc #0
ret
END(cloudabi_sys_thread_yield)
diff --git a/sys/contrib/cloudabi/cloudabi_vdso_armv6.S b/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
index 6fc626d19813..7ca7a39419d6 100644
--- a/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
+++ b/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
@@ -365,43 +365,27 @@ ENTRY(cloudabi_sys_random_get)
bx lr
END(cloudabi_sys_random_get)
-ENTRY(cloudabi_sys_sock_accept)
- str r2, [sp, #-4]
- mov ip, #44
- swi 0
- ldrcc r2, [sp, #-4]
- strcc r0, [r2]
- movcc r0, $0
- bx lr
-END(cloudabi_sys_sock_accept)
-
ENTRY(cloudabi_sys_sock_recv)
- mov ip, #45
+ mov ip, #44
swi 0
bx lr
END(cloudabi_sys_sock_recv)
ENTRY(cloudabi_sys_sock_send)
- mov ip, #46
+ mov ip, #45
swi 0
bx lr
END(cloudabi_sys_sock_send)
ENTRY(cloudabi_sys_sock_shutdown)
- mov ip, #47
+ mov ip, #46
swi 0
bx lr
END(cloudabi_sys_sock_shutdown)
-ENTRY(cloudabi_sys_sock_stat_get)
- mov ip, #48
- swi 0
- bx lr
-END(cloudabi_sys_sock_stat_get)
-
ENTRY(cloudabi_sys_thread_create)
str r1, [sp, #-4]
- mov ip, #49
+ mov ip, #47
swi 0
ldrcc r2, [sp, #-4]
strcc r0, [r2]
@@ -410,12 +394,12 @@ ENTRY(cloudabi_sys_thread_create)
END(cloudabi_sys_thread_create)
ENTRY(cloudabi_sys_thread_exit)
- mov ip, #50
+ mov ip, #48
swi 0
END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
- mov ip, #51
+ mov ip, #49
swi 0
bx lr
END(cloudabi_sys_thread_yield)
diff --git a/sys/contrib/cloudabi/cloudabi_vdso_i686.S b/sys/contrib/cloudabi/cloudabi_vdso_i686.S
index 47d02b254f1b..135ea8d55bf1 100644
--- a/sys/contrib/cloudabi/cloudabi_vdso_i686.S
+++ b/sys/contrib/cloudabi/cloudabi_vdso_i686.S
@@ -389,43 +389,26 @@ ENTRY(cloudabi_sys_random_get)
ret
END(cloudabi_sys_random_get)
-ENTRY(cloudabi_sys_sock_accept)
- mov $44, %eax
- int $0x80
- jc 1f
- mov 12(%esp), %ecx
- mov %eax, (%ecx)
- xor %eax, %eax
-1:
- ret
-END(cloudabi_sys_sock_accept)
-
ENTRY(cloudabi_sys_sock_recv)
- mov $45, %eax
+ mov $44, %eax
int $0x80
ret
END(cloudabi_sys_sock_recv)
ENTRY(cloudabi_sys_sock_send)
- mov $46, %eax
+ mov $45, %eax
int $0x80
ret
END(cloudabi_sys_sock_send)
ENTRY(cloudabi_sys_sock_shutdown)
- mov $47, %eax
+ mov $46, %eax
int $0x80
ret
END(cloudabi_sys_sock_shutdown)
-ENTRY(cloudabi_sys_sock_stat_get)
- mov $48, %eax
- int $0x80
- ret
-END(cloudabi_sys_sock_stat_get)
-
ENTRY(cloudabi_sys_thread_create)
- mov $49, %eax
+ mov $47, %eax
int $0x80
jc 1f
mov 8(%esp), %ecx
@@ -436,12 +419,12 @@ ENTRY(cloudabi_sys_thread_create)
END(cloudabi_sys_thread_create)
ENTRY(cloudabi_sys_thread_exit)
- mov $50, %eax
+ mov $48, %eax
int $0x80
END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
- mov $51, %eax
+ mov $49, %eax
int $0x80
ret
END(cloudabi_sys_thread_yield)
diff --git a/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S b/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
index 460936c6f227..009f928d71e5 100644
--- a/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
+++ b/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
@@ -993,28 +993,6 @@ ENTRY(cloudabi_sys_random_get)
ret
END(cloudabi_sys_random_get)
-ENTRY(cloudabi_sys_sock_accept)
- push %ebp
- mov %esp, %ebp
- mov 8(%ebp), %ecx
- mov %ecx, -16(%ebp)
- mov 12(%ebp), %ecx
- mov %ecx, -8(%ebp)
- movl $0, -4(%ebp)
- mov $44, %eax
- mov %ebp, %ecx
- sub $16, %ecx
- int $0x80
- test %eax, %eax
- jnz 1f
- mov 16(%ebp), %ecx
- mov -16(%ebp), %edx
- mov %edx, 0(%ecx)
-1:
- pop %ebp
- ret
-END(cloudabi_sys_sock_accept)
-
ENTRY(cloudabi_sys_sock_recv)
push %ebp
mov %esp, %ebp
@@ -1026,7 +1004,7 @@ ENTRY(cloudabi_sys_sock_recv)
mov 16(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
- mov $45, %eax
+ mov $44, %eax
mov %ebp, %ecx
sub $24, %ecx
int $0x80
@@ -1045,7 +1023,7 @@ ENTRY(cloudabi_sys_sock_send)
mov 16(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
- mov $46, %eax
+ mov $45, %eax
mov %ebp, %ecx
sub $24, %ecx
int $0x80
@@ -1060,7 +1038,7 @@ ENTRY(cloudabi_sys_sock_shutdown)
mov %ecx, -16(%ebp)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
- mov $47, %eax
+ mov $46, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@@ -1068,31 +1046,13 @@ ENTRY(cloudabi_sys_sock_shutdown)
ret
END(cloudabi_sys_sock_shutdown)
-ENTRY(cloudabi_sys_sock_stat_get)
- push %ebp
- mov %esp, %ebp
- mov 8(%ebp), %ecx
- mov %ecx, -24(%ebp)
- mov 12(%ebp), %ecx
- mov %ecx, -16(%ebp)
- movl $0, -12(%ebp)
- mov 16(%ebp), %ecx
- mov %ecx, -8(%ebp)
- mov $48, %eax
- mov %ebp, %ecx
- sub $24, %ecx
- int $0x80
- pop %ebp
- ret
-END(cloudabi_sys_sock_stat_get)
-
ENTRY(cloudabi_sys_thread_create)
push %ebp
mov %esp, %ebp
mov 8(%ebp), %ecx
mov %ecx, -16(%ebp)
movl $0, -12(%ebp)
- mov $49, %eax
+ mov $47, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@@ -1114,7 +1074,7 @@ ENTRY(cloudabi_sys_thread_exit)
movl $0, -12(%ebp)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
- mov $50, %eax
+ mov $48, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@@ -1123,7 +1083,7 @@ END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
push %ebp
mov %esp, %ebp
- mov $51, %eax
+ mov $49, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
diff --git a/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S b/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S
index 18e89ed55488..217bd1cbea0a 100644
--- a/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S
+++ b/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S
@@ -419,45 +419,27 @@ ENTRY(cloudabi_sys_random_get)
ret
END(cloudabi_sys_random_get)
-ENTRY(cloudabi_sys_sock_accept)
- push %rdx
- mov $44, %eax
- syscall
- pop %rcx
- jc 1f
- mov %eax, (%rcx)
- xor %eax, %eax
-1:
- ret
-END(cloudabi_sys_sock_accept)
-
ENTRY(cloudabi_sys_sock_recv)
- mov $45, %eax
+ mov $44, %eax
syscall
ret
END(cloudabi_sys_sock_recv)
ENTRY(cloudabi_sys_sock_send)
- mov $46, %eax
+ mov $45, %eax
syscall
ret
END(cloudabi_sys_sock_send)
ENTRY(cloudabi_sys_sock_shutdown)
- mov $47, %eax
+ mov $46, %eax
syscall
ret
END(cloudabi_sys_sock_shutdown)
-ENTRY(cloudabi_sys_sock_stat_get)
- mov $48, %eax
- syscall
- ret
-END(cloudabi_sys_sock_stat_get)
-
ENTRY(cloudabi_sys_thread_create)
push %rsi
- mov $49, %eax
+ mov $47, %eax
syscall
pop %rcx
jc 1f
@@ -468,12 +450,12 @@ ENTRY(cloudabi_sys_thread_create)
END(cloudabi_sys_thread_create)
ENTRY(cloudabi_sys_thread_exit)
- mov $50, %eax
+ mov $48, %eax
syscall
END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
- mov $51, %eax
+ mov $49, %eax
syscall
ret
END(cloudabi_sys_thread_yield)
diff --git a/sys/contrib/cloudabi/syscalls32.master b/sys/contrib/cloudabi/syscalls32.master
index 69c2f8d250c4..6ed39ec7ed98 100644
--- a/sys/contrib/cloudabi/syscalls32.master
+++ b/sys/contrib/cloudabi/syscalls32.master
@@ -258,34 +258,25 @@
void *buf, \
size_t buf_len); }
-44 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
- cloudabi_fd_t sock, \
- void *unused); }
-
-45 AUE_NULL STD { void cloudabi32_sys_sock_recv( \
+44 AUE_NULL STD { void cloudabi32_sys_sock_recv( \
cloudabi_fd_t sock, \
const cloudabi32_recv_in_t *in, \
cloudabi32_recv_out_t *out); }
-46 AUE_NULL STD { void cloudabi32_sys_sock_send( \
+45 AUE_NULL STD { void cloudabi32_sys_sock_send( \
cloudabi_fd_t sock, \
const cloudabi32_send_in_t *in, \
cloudabi32_send_out_t *out); }
-47 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
+46 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
cloudabi_fd_t sock, \
cloudabi_sdflags_t how); }
-48 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \
- cloudabi_fd_t sock, \
- cloudabi_sockstat_t *buf, \
- cloudabi_ssflags_t flags); }
-
-49 AUE_NULL STD { cloudabi_tid_t cloudabi32_sys_thread_create( \
+47 AUE_NULL STD { cloudabi_tid_t cloudabi32_sys_thread_create( \
cloudabi32_threadattr_t *attr); }
-50 AUE_NULL STD { void cloudabi_sys_thread_exit( \
+48 AUE_NULL STD { void cloudabi_sys_thread_exit( \
cloudabi_lock_t *lock, \
cloudabi_scope_t scope); }
-51 AUE_NULL STD { void cloudabi_sys_thread_yield(); }
+49 AUE_NULL STD { void cloudabi_sys_thread_yield(); }
diff --git a/sys/contrib/cloudabi/syscalls64.master b/sys/contrib/cloudabi/syscalls64.master
index 642bb8c6e9db..81a77dcbefd1 100644
--- a/sys/contrib/cloudabi/syscalls64.master
+++ b/sys/contrib/cloudabi/syscalls64.master
@@ -258,34 +258,25 @@
void *buf, \
size_t buf_len); }
-44 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
- cloudabi_fd_t sock, \
- void *unused); }
-
-45 AUE_NULL STD { void cloudabi64_sys_sock_recv( \
+44 AUE_NULL STD { void cloudabi64_sys_sock_recv( \
cloudabi_fd_t sock, \
const cloudabi64_recv_in_t *in, \
cloudabi64_recv_out_t *out); }
-46 AUE_NULL STD { void cloudabi64_sys_sock_send( \
+45 AUE_NULL STD { void cloudabi64_sys_sock_send( \
cloudabi_fd_t sock, \
const cloudabi64_send_in_t *in, \
cloudabi64_send_out_t *out); }
-47 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
+46 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
cloudabi_fd_t sock, \
cloudabi_sdflags_t how); }
-48 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \
- cloudabi_fd_t sock, \
- cloudabi_sockstat_t *buf, \
- cloudabi_ssflags_t flags); }
-
-49 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \
+47 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \
cloudabi64_threadattr_t *attr); }
-50 AUE_NULL STD { void cloudabi_sys_thread_exit( \
+48 AUE_NULL STD { void cloudabi_sys_thread_exit( \
cloudabi_lock_t *lock, \
cloudabi_scope_t scope); }
-51 AUE_NULL STD { void cloudabi_sys_thread_yield(); }
+49 AUE_NULL STD { void cloudabi_sys_thread_yield(); }