mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-14 10:18:02 +00:00
Get LIBC_RUNTIME and LIBC_CALLS building on aarch64
This commit is contained in:
parent
7e46645193
commit
e5e3cdf447
1200 changed files with 5341 additions and 3677 deletions
1
Makefile
1
Makefile
|
@ -126,7 +126,6 @@ include third_party/zlib/zlib.mk # │
|
||||||
include third_party/double-conversion/dc.mk # │
|
include third_party/double-conversion/dc.mk # │
|
||||||
include libc/elf/elf.mk # │
|
include libc/elf/elf.mk # │
|
||||||
include ape/ape.mk # │
|
include ape/ape.mk # │
|
||||||
include libc/aarch64/aarch64.mk # │
|
|
||||||
include libc/fmt/fmt.mk # │
|
include libc/fmt/fmt.mk # │
|
||||||
include libc/vga/vga.mk #─┘
|
include libc/vga/vga.mk #─┘
|
||||||
include libc/calls/calls.mk #─┐
|
include libc/calls/calls.mk #─┐
|
||||||
|
|
58
ape/ape.mk
58
ape/ape.mk
|
@ -19,11 +19,21 @@ APE_FILES := $(wildcard ape/*.*)
|
||||||
APE_HDRS = $(filter %.h,$(APE_FILES))
|
APE_HDRS = $(filter %.h,$(APE_FILES))
|
||||||
APE_INCS = $(filter %.inc,$(APE_FILES))
|
APE_INCS = $(filter %.inc,$(APE_FILES))
|
||||||
|
|
||||||
ifneq ($(MODE), aarch64)
|
|
||||||
|
|
||||||
APE = o/$(MODE)/ape/ape.o \
|
APE = o/$(MODE)/ape/ape.o \
|
||||||
o/$(MODE)/ape/ape.lds
|
o/$(MODE)/ape/ape.lds
|
||||||
|
|
||||||
|
ifeq ($(MODE), aarch64)
|
||||||
|
|
||||||
|
APE_SRCS = ape/ape.S
|
||||||
|
APE_OBJS = o/$(MODE)/ape/ape.o
|
||||||
|
APE_NO_MODIFY_SELF = $(APE)
|
||||||
|
APE_COPY_SELF = $(APE)
|
||||||
|
|
||||||
|
.PHONY: o/$(MODE)/ape
|
||||||
|
o/$(MODE)/ape: $(APE)
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
APE_NO_MODIFY_SELF = \
|
APE_NO_MODIFY_SELF = \
|
||||||
o/$(MODE)/ape/ape.lds \
|
o/$(MODE)/ape/ape.lds \
|
||||||
o/$(MODE)/ape/ape-no-modify-self.o
|
o/$(MODE)/ape/ape-no-modify-self.o
|
||||||
|
@ -61,22 +71,6 @@ APE_SRCS = $(APE_SRCS_C) $(APE_SRCS_S)
|
||||||
APE_OBJS = $(APE_SRCS_S:%.S=o/$(MODE)/%.o)
|
APE_OBJS = $(APE_SRCS_S:%.S=o/$(MODE)/%.o)
|
||||||
APE_CHECKS = $(APE_HDRS:%=o/%.ok)
|
APE_CHECKS = $(APE_HDRS:%=o/%.ok)
|
||||||
|
|
||||||
o/$(MODE)/ape/ape.lds: \
|
|
||||||
ape/ape.lds \
|
|
||||||
ape/macros.internal.h \
|
|
||||||
ape/relocations.h \
|
|
||||||
libc/intrin/bits.h \
|
|
||||||
libc/thread/tls.h \
|
|
||||||
libc/calls/struct/timespec.h \
|
|
||||||
libc/thread/thread.h \
|
|
||||||
libc/dce.h \
|
|
||||||
libc/elf/def.h \
|
|
||||||
libc/elf/pf2prot.internal.h \
|
|
||||||
libc/macros.internal.h \
|
|
||||||
libc/nt/pedef.internal.h \
|
|
||||||
libc/str/str.h \
|
|
||||||
libc/zip.h
|
|
||||||
|
|
||||||
o/$(MODE)/ape/public/ape.lds: OVERRIDE_CPPFLAGS += -UCOSMO
|
o/$(MODE)/ape/public/ape.lds: OVERRIDE_CPPFLAGS += -UCOSMO
|
||||||
o/$(MODE)/ape/public/ape.lds: \
|
o/$(MODE)/ape/public/ape.lds: \
|
||||||
ape/public/ape.lds \
|
ape/public/ape.lds \
|
||||||
|
@ -99,10 +93,6 @@ o/ape/idata.inc: \
|
||||||
ape/idata.internal.h \
|
ape/idata.internal.h \
|
||||||
ape/relocations.h
|
ape/relocations.h
|
||||||
|
|
||||||
o/$(MODE)/ape/ape.o: \
|
|
||||||
ape/blink-aarch64.gz \
|
|
||||||
ape/blink-darwin-arm64.gz
|
|
||||||
|
|
||||||
o/$(MODE)/ape/ape-no-modify-self.o: \
|
o/$(MODE)/ape/ape-no-modify-self.o: \
|
||||||
ape/ape.S \
|
ape/ape.S \
|
||||||
ape/macros.internal.h \
|
ape/macros.internal.h \
|
||||||
|
@ -199,3 +189,27 @@ o/$(MODE)/ape: $(APE_CHECKS) \
|
||||||
o/$(MODE)/ape/ape-no-modify-self.o
|
o/$(MODE)/ape/ape-no-modify-self.o
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# these assembly files are safe to build on aarch64
|
||||||
|
o/$(MODE)/ape/ape.o: ape/ape.S
|
||||||
|
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $<
|
||||||
|
|
||||||
|
o/$(MODE)/ape/ape.o: \
|
||||||
|
ape/blink-aarch64.gz \
|
||||||
|
ape/blink-darwin-arm64.gz
|
||||||
|
|
||||||
|
o/$(MODE)/ape/ape.lds: \
|
||||||
|
ape/ape.lds \
|
||||||
|
ape/macros.internal.h \
|
||||||
|
ape/relocations.h \
|
||||||
|
libc/intrin/bits.h \
|
||||||
|
libc/thread/tls.h \
|
||||||
|
libc/calls/struct/timespec.h \
|
||||||
|
libc/thread/thread.h \
|
||||||
|
libc/dce.h \
|
||||||
|
libc/elf/def.h \
|
||||||
|
libc/elf/pf2prot.internal.h \
|
||||||
|
libc/macros.internal.h \
|
||||||
|
libc/nt/pedef.internal.h \
|
||||||
|
libc/str/str.h \
|
||||||
|
libc/zip.h
|
||||||
|
|
|
@ -63,13 +63,10 @@
|
||||||
.size "\dll\().\actual",.-"\dll\().\actual"
|
.size "\dll\().\actual",.-"\dll\().\actual"
|
||||||
.previous
|
.previous
|
||||||
#else
|
#else
|
||||||
.section ".text.nt.\actual","ax",@progbits
|
|
||||||
.globl "\actual"
|
|
||||||
"\actual":
|
|
||||||
ret
|
|
||||||
.section ".data.nt.\actual","aw",@progbits
|
.section ".data.nt.\actual","aw",@progbits
|
||||||
.globl "\fn"
|
.globl "\fn"
|
||||||
.balign 8
|
.balign 8
|
||||||
|
.weak "\actual"
|
||||||
"\fn": .quad "\actual"
|
"\fn": .quad "\actual"
|
||||||
#endif
|
#endif
|
||||||
.endm
|
.endm
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
|
||||||
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
|
||||||
|
|
||||||
o/$(MODE)/libc/aarch64/%.o: libc/aarch64/%.S
|
|
||||||
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $<
|
|
||||||
|
|
||||||
o/$(MODE)/libc/aarch64/start.o: \
|
|
||||||
libc/aarch64/start.c \
|
|
||||||
libc/runtime/runtime.h
|
|
||||||
|
|
||||||
o/$(MODE)/libc/aarch64: \
|
|
||||||
o/$(MODE)/libc/aarch64/crt.o \
|
|
||||||
o/$(MODE)/libc/aarch64/start.o
|
|
21
libc/calls/__clock_gettime.c
Normal file
21
libc/calls/__clock_gettime.c
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||||
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||||
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||||
|
│ Copyright 2023 Justine Alexandra Roberts Tunney │
|
||||||
|
│ │
|
||||||
|
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||||
|
│ any purpose with or without fee is hereby granted, provided that the │
|
||||||
|
│ above copyright notice and this permission notice appear in all copies. │
|
||||||
|
│ │
|
||||||
|
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||||
|
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||||
|
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||||
|
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||||
|
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||||
|
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||||
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||||
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
|
#include "libc/calls/clock_gettime.internal.h"
|
||||||
|
|
||||||
|
clock_gettime_f *__clock_gettime = __clock_gettime_init;
|
|
@ -51,7 +51,8 @@ LIBC_CALLS_A_DIRECTDEPS = \
|
||||||
LIBC_STR \
|
LIBC_STR \
|
||||||
LIBC_STUBS \
|
LIBC_STUBS \
|
||||||
LIBC_SYSV_CALLS \
|
LIBC_SYSV_CALLS \
|
||||||
LIBC_SYSV
|
LIBC_SYSV \
|
||||||
|
THIRD_PARTY_COMPILER_RT
|
||||||
|
|
||||||
LIBC_CALLS_A_DEPS := \
|
LIBC_CALLS_A_DEPS := \
|
||||||
$(call uniq,$(foreach x,$(LIBC_CALLS_A_DIRECTDEPS),$($(x))))
|
$(call uniq,$(foreach x,$(LIBC_CALLS_A_DIRECTDEPS),$($(x))))
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#include "libc/calls/calls.h"
|
#include "libc/calls/calls.h"
|
||||||
#include "libc/intrin/lockxadd.h"
|
|
||||||
#include "libc/nt/process.h"
|
#include "libc/nt/process.h"
|
||||||
|
|
||||||
static textwindows char16_t *UintToChar16Array(char16_t p[21], uint64_t x) {
|
static textwindows char16_t *UintToChar16Array(char16_t p[21], uint64_t x) {
|
||||||
|
@ -44,7 +43,7 @@ textwindows char16_t *CreatePipeName(char16_t *a) {
|
||||||
while (*q) *p++ = *q++;
|
while (*q) *p++ = *q++;
|
||||||
p = UintToChar16Array(p, GetCurrentProcessId());
|
p = UintToChar16Array(p, GetCurrentProcessId());
|
||||||
*p++ = '-';
|
*p++ = '-';
|
||||||
p = UintToChar16Array(p, _lockxadd(&x, 1));
|
p = UintToChar16Array(p, (x += 1));
|
||||||
*p = 0;
|
*p = 0;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#include "libc/calls/calls.h"
|
#include "libc/calls/calls.h"
|
||||||
#include "libc/calls/syscall-nt.internal.h"
|
#include "libc/calls/syscall-nt.internal.h"
|
||||||
|
#include "libc/calls/syscall-sysv.internal.h"
|
||||||
#include "libc/dce.h"
|
#include "libc/dce.h"
|
||||||
#include "libc/errno.h"
|
#include "libc/errno.h"
|
||||||
#include "libc/intrin/asmflag.h"
|
#include "libc/intrin/asmflag.h"
|
||||||
|
@ -74,21 +75,10 @@ privileged int getpriority(int which, unsigned who) {
|
||||||
} else {
|
} else {
|
||||||
rc = sys_getpriority_nt(which, who);
|
rc = sys_getpriority_nt(which, who);
|
||||||
}
|
}
|
||||||
#elif defined(__aarch64__)
|
#else
|
||||||
register long r0 asm("x0") = (long)which;
|
rc = sys_getpriority(which, who);
|
||||||
register long r1 asm("x1") = (long)who;
|
if (rc != -1) {
|
||||||
register long res_x0 asm("x0");
|
|
||||||
asm volatile("mov\tx8,%1\n\t"
|
|
||||||
"svc\t0"
|
|
||||||
: "=r"(res_x0)
|
|
||||||
: "i"(141), "r"(r0), "r"(r1)
|
|
||||||
: "x8", "memory");
|
|
||||||
rc = res_x0;
|
|
||||||
if (rc >= 0) {
|
|
||||||
rc = NZERO - rc;
|
rc = NZERO - rc;
|
||||||
} else {
|
|
||||||
errno = -rc;
|
|
||||||
rc = -1;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
STRACE("getpriority(%s, %u) → %d% m", DescribeWhichPrio(which), who, rc);
|
STRACE("getpriority(%s, %u) → %d% m", DescribeWhichPrio(which), who, rc);
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
#include "libc/time/struct/timezone.h"
|
#include "libc/time/struct/timezone.h"
|
||||||
|
|
||||||
typedef axdx_t gettimeofday_f(struct timeval *, struct timezone *, void *);
|
typedef axdx_t gettimeofday_f(struct timeval *, struct timezone *, void *);
|
||||||
|
static gettimeofday_f __gettimeofday_init;
|
||||||
extern gettimeofday_f *__gettimeofday;
|
static gettimeofday_f *__gettimeofday = __gettimeofday_init;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns system wall time in microseconds, e.g.
|
* Returns system wall time in microseconds, e.g.
|
||||||
|
@ -97,8 +97,10 @@ gettimeofday_f *__gettimeofday_get(bool *opt_out_isfast) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Hide int __gettimeofday_init(struct timeval *tv, struct timezone *tz) {
|
static axdx_t __gettimeofday_init(struct timeval *tv, //
|
||||||
|
struct timezone *tz, //
|
||||||
|
void *arg) {
|
||||||
gettimeofday_f *gettime;
|
gettimeofday_f *gettime;
|
||||||
__gettimeofday = gettime = __gettimeofday_get(0);
|
__gettimeofday = gettime = __gettimeofday_get(0);
|
||||||
return gettime(tv, tz, 0).ax;
|
return gettime(tv, tz, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,19 +65,8 @@ privileged void *sys_mremap(void *p, size_t n, size_t m, int f, void *q) {
|
||||||
res = enosys();
|
res = enosys();
|
||||||
}
|
}
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
long res;
|
void *res;
|
||||||
register long r0 asm("x0") = (long)p;
|
res = __sys_mremap(p, n, m, f, q);
|
||||||
register long r1 asm("x1") = (long)n;
|
|
||||||
register long r2 asm("x2") = (long)m;
|
|
||||||
register long r3 asm("x3") = (long)f;
|
|
||||||
register long r4 asm("x4") = (long)q;
|
|
||||||
register long res_x0 asm("x0");
|
|
||||||
asm volatile("mov\tx8,%1\n\t"
|
|
||||||
"svc\t0"
|
|
||||||
: "=r"(res_x0)
|
|
||||||
: "i"(216), "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4)
|
|
||||||
: "x8", "memory");
|
|
||||||
res = _sysret64(res_x0);
|
|
||||||
#else
|
#else
|
||||||
#error "arch unsupported"
|
#error "arch unsupported"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -112,3 +112,5 @@ long double nowl_setup(void) {
|
||||||
}
|
}
|
||||||
return nowl();
|
return nowl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long double (*nowl)(void) = nowl_setup;
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include "libc/thread/tls.h"
|
#include "libc/thread/tls.h"
|
||||||
#include "libc/thread/tls2.h"
|
#include "libc/thread/tls2.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
textwindows bool32 __onntconsoleevent(uint32_t dwCtrlType) {
|
textwindows bool32 __onntconsoleevent(uint32_t dwCtrlType) {
|
||||||
struct CosmoTib tib;
|
struct CosmoTib tib;
|
||||||
struct StackFrame *fr;
|
struct StackFrame *fr;
|
||||||
|
@ -60,3 +62,5 @@ textwindows bool32 __onntconsoleevent(uint32_t dwCtrlType) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
#include "libc/sysv/errfuns.h"
|
#include "libc/sysv/errfuns.h"
|
||||||
#include "libc/zipos/zipos.internal.h"
|
#include "libc/zipos/zipos.internal.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
int sys_openat_metal(int dirfd, const char *file, int flags, unsigned mode) {
|
int sys_openat_metal(int dirfd, const char *file, int flags, unsigned mode) {
|
||||||
int fd;
|
int fd;
|
||||||
struct MetalFile *state;
|
struct MetalFile *state;
|
||||||
|
@ -61,3 +63,5 @@ int sys_openat_metal(int dirfd, const char *file, int flags, unsigned mode) {
|
||||||
g_fds.p[fd].handle = (intptr_t)state;
|
g_fds.p[fd].handle = (intptr_t)state;
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#include "libc/macros.internal.h"
|
#include "libc/macros.internal.h"
|
||||||
#include "libc/str/str.h"
|
#include "libc/str/str.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
static int FindPromise(const char *name) {
|
static int FindPromise(const char *name) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < ARRAYLEN(kPledge); ++i) {
|
for (i = 0; i < ARRAYLEN(kPledge); ++i) {
|
||||||
|
@ -64,3 +66,5 @@ int ParsePromises(const char *promises, unsigned long *out) {
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include "libc/runtime/runtime.h"
|
#include "libc/runtime/runtime.h"
|
||||||
#include "libc/sysv/errfuns.h"
|
#include "libc/sysv/errfuns.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permits system operations, e.g.
|
* Permits system operations, e.g.
|
||||||
*
|
*
|
||||||
|
@ -276,3 +278,5 @@ int pledge(const char *promises, const char *execpromises) {
|
||||||
STRACE("pledge(%#s, %#s) → %d% m", promises, execpromises, rc);
|
STRACE("pledge(%#s, %#s) → %d% m", promises, execpromises, rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
#include "libc/sysv/consts/sig.h"
|
#include "libc/sysv/consts/sig.h"
|
||||||
#include "libc/sysv/errfuns.h"
|
#include "libc/sysv/errfuns.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Polls on the New Technology.
|
* Polls on the New Technology.
|
||||||
*
|
*
|
||||||
|
@ -218,3 +220,5 @@ ReturnPath:
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -66,7 +66,7 @@ privileged int prctl(int operation, ...) {
|
||||||
: "=r"(res_x0)
|
: "=r"(res_x0)
|
||||||
: "i"(167), "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4)
|
: "i"(167), "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4)
|
||||||
: "x8", "memory");
|
: "x8", "memory");
|
||||||
rc = _sysret32(res_x0);
|
rc = _sysret(res_x0);
|
||||||
#else
|
#else
|
||||||
#error "arch unsupported"
|
#error "arch unsupported"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
|
|
||||||
│vi: set et ft=asm ts=8 sw=8 fenc=utf-8 :vi│
|
|
||||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
|
||||||
│ Copyright 2020 Justine Alexandra Roberts Tunney │
|
|
||||||
│ │
|
|
||||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
|
||||||
│ any purpose with or without fee is hereby granted, provided that the │
|
|
||||||
│ above copyright notice and this permission notice appear in all copies. │
|
|
||||||
│ │
|
|
||||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
|
||||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
|
||||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
|
||||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
|
||||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
|
||||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
|
||||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
|
||||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
|
||||||
#include "libc/macros.internal.h"
|
|
||||||
|
|
||||||
.initbss 400,_init_program_invocation_short_name
|
|
||||||
// Supplies basename(argv[0]) The GNU Way.
|
|
||||||
//
|
|
||||||
// If argv[0] isn't supplied, this value will be null.
|
|
||||||
//
|
|
||||||
// @see GetProgramExecutableName()
|
|
||||||
// @see program_invocation_name
|
|
||||||
program_invocation_short_name:
|
|
||||||
.quad 0
|
|
||||||
.endobj program_invocation_short_name,globl
|
|
||||||
.previous
|
|
||||||
|
|
||||||
.init.start 400,_init_program_invocation_short_name
|
|
||||||
push %rsi
|
|
||||||
xor %eax,%eax
|
|
||||||
test %r12d,%r12d # argc
|
|
||||||
jz 2f
|
|
||||||
mov (%r13),%rsi # argv[0]
|
|
||||||
mov %rsi,%rcx
|
|
||||||
1: lodsb
|
|
||||||
cmp $'/',%al
|
|
||||||
cmoveq %rsi,%rcx
|
|
||||||
cmp $'\\',%al
|
|
||||||
cmoveq %rsi,%rcx
|
|
||||||
test %al,%al
|
|
||||||
jnz 1b
|
|
||||||
xchg %rcx,%rax
|
|
||||||
pop %rsi
|
|
||||||
2: stosq
|
|
||||||
.init.end 400,_init_program_invocation_short_name
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||||
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||||
│ Copyright 2023 Justine Alexandra Roberts Tunney │
|
│ Copyright 2023 Justine Alexandra Roberts Tunney │
|
||||||
│ │
|
│ │
|
||||||
|
@ -16,38 +16,19 @@
|
||||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
|
#include "libc/runtime/runtime.h"
|
||||||
|
#include "libc/str/str.h"
|
||||||
|
|
||||||
.globl _start
|
char *program_invocation_short_name;
|
||||||
.type _start,%function
|
|
||||||
_start: mov x29,#0
|
|
||||||
mov x30,#0
|
|
||||||
mov x0,sp
|
|
||||||
and sp,x0,#-16
|
|
||||||
b _start_c
|
|
||||||
.size _start,.-_start
|
|
||||||
|
|
||||||
.section .initprologue
|
__attribute__((__constructor__)) static void //
|
||||||
.global _init
|
program_invocation_short_name_init(void) {
|
||||||
.type _init,%function
|
char *p, *r;
|
||||||
_init: stp x29,x30,[sp,-16]!
|
if (!__argc) return;
|
||||||
mov x29,sp
|
if ((p = strrchr(__argv[0], '/'))) {
|
||||||
.previous/*
|
r = p + 1;
|
||||||
...
|
} else {
|
||||||
decentralized content
|
r = __argv[0];
|
||||||
...
|
}
|
||||||
*/.section .initepilogue
|
program_invocation_short_name = r;
|
||||||
ldp x29,x30,[sp],#16
|
}
|
||||||
ret
|
|
||||||
|
|
||||||
.section .finiprologue
|
|
||||||
.global _fini
|
|
||||||
.type _fini,%function
|
|
||||||
_fini: stp x29,x30,[sp,-16]!
|
|
||||||
mov x29,sp
|
|
||||||
.previous/*
|
|
||||||
...
|
|
||||||
decentralized content
|
|
||||||
...
|
|
||||||
*/.section .finiepilogue
|
|
||||||
ldp x29,x30,[sp],#16
|
|
||||||
ret
|
|
|
@ -26,6 +26,8 @@
|
||||||
#include "libc/sysv/errfuns.h"
|
#include "libc/sysv/errfuns.h"
|
||||||
#include "libc/vga/vga.internal.h"
|
#include "libc/vga/vga.internal.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
ssize_t sys_readv_metal(struct Fd *fd, const struct iovec *iov, int iovlen) {
|
ssize_t sys_readv_metal(struct Fd *fd, const struct iovec *iov, int iovlen) {
|
||||||
int i;
|
int i;
|
||||||
size_t got, toto;
|
size_t got, toto;
|
||||||
|
@ -56,3 +58,5 @@ ssize_t sys_readv_metal(struct Fd *fd, const struct iovec *iov, int iovlen) {
|
||||||
return ebadf();
|
return ebadf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -74,7 +74,7 @@ privileged int seccomp(unsigned operation, unsigned flags, void *args) {
|
||||||
: "=r"(res_x0)
|
: "=r"(res_x0)
|
||||||
: "i"(211), "r"(r0), "r"(r1), "r"(r2)
|
: "i"(211), "r"(r0), "r"(r1), "r"(r2)
|
||||||
: "x8", "memory");
|
: "x8", "memory");
|
||||||
rc = _sysret32(res_x0);
|
rc = _sysret(res_x0);
|
||||||
#else
|
#else
|
||||||
#error "arch unsupported"
|
#error "arch unsupported"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
#include "libc/sysv/errfuns.h"
|
#include "libc/sysv/errfuns.h"
|
||||||
#include "libc/time/time.h"
|
#include "libc/time/time.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Heartbreaking polyfill for SIGALRM on NT.
|
* @fileoverview Heartbreaking polyfill for SIGALRM on NT.
|
||||||
*
|
*
|
||||||
|
@ -130,3 +132,5 @@ textwindows int sys_setitimer_nt(int which, const struct itimerval *newvalue,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -255,7 +255,9 @@ static int __sigaction(int sig, const struct sigaction *act,
|
||||||
if (act) {
|
if (act) {
|
||||||
__sighandrvas[sig] = rva;
|
__sighandrvas[sig] = rva;
|
||||||
__sighandflags[sig] = act->sa_flags;
|
__sighandflags[sig] = act->sa_flags;
|
||||||
__sig_check_ignore(sig, rva);
|
if (IsWindows()) {
|
||||||
|
__sig_check_ignore(sig, rva);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include "libc/sysv/consts/sicode.h"
|
#include "libc/sysv/consts/sicode.h"
|
||||||
#include "libc/sysv/consts/sig.h"
|
#include "libc/sysv/consts/sig.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks to see if SIGCHLD should be raised on Windows.
|
* Checks to see if SIGCHLD should be raised on Windows.
|
||||||
* @return true if a signal was raised
|
* @return true if a signal was raised
|
||||||
|
@ -67,3 +69,5 @@ void _check_sigchld(void) {
|
||||||
__fds_unlock();
|
__fds_unlock();
|
||||||
__sig_add(0, SIGCHLD, CLD_EXITED);
|
__sig_add(0, SIGCHLD, CLD_EXITED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include "libc/sysv/consts/sig.h"
|
#include "libc/sysv/consts/sig.h"
|
||||||
#include "libc/thread/tls.h"
|
#include "libc/thread/tls.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
static struct winsize __ws;
|
static struct winsize __ws;
|
||||||
|
|
||||||
textwindows void _check_sigwinch(struct Fd *fd) {
|
textwindows void _check_sigwinch(struct Fd *fd) {
|
||||||
|
@ -58,3 +60,5 @@ textwindows void _check_sigwinch(struct Fd *fd) {
|
||||||
}
|
}
|
||||||
errno = e;
|
errno = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -10,9 +10,6 @@ COSMOPOLITAN_C_START_
|
||||||
│ cosmopolitan § syscalls » system five » structless synthetic jump slots ─╬─│┼
|
│ cosmopolitan § syscalls » system five » structless synthetic jump slots ─╬─│┼
|
||||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||||
|
|
||||||
int _sysret32(long) asm("_sysret");
|
|
||||||
long _sysret64(long) asm("_sysret");
|
|
||||||
|
|
||||||
axdx_t __sys_fork(void) _Hide;
|
axdx_t __sys_fork(void) _Hide;
|
||||||
axdx_t __sys_pipe(i32[hasatleast 2], i32) _Hide;
|
axdx_t __sys_pipe(i32[hasatleast 2], i32) _Hide;
|
||||||
axdx_t sys_getpid(void) _Hide;
|
axdx_t sys_getpid(void) _Hide;
|
||||||
|
@ -65,6 +62,7 @@ i32 sys_getresgid(u32 *, u32 *, u32 *) _Hide;
|
||||||
i32 sys_getresuid(u32 *, u32 *, u32 *) _Hide;
|
i32 sys_getresuid(u32 *, u32 *, u32 *) _Hide;
|
||||||
i32 sys_getsid(i32) _Hide;
|
i32 sys_getsid(i32) _Hide;
|
||||||
i32 sys_gettid(void) _Hide;
|
i32 sys_gettid(void) _Hide;
|
||||||
|
i32 sys_ioctl(i32, u64, ...) _Hide;
|
||||||
i32 sys_ioctl_cp(i32, u64, ...) _Hide;
|
i32 sys_ioctl_cp(i32, u64, ...) _Hide;
|
||||||
i32 sys_issetugid(void) _Hide;
|
i32 sys_issetugid(void) _Hide;
|
||||||
i32 sys_kill(i32, i32, i32) _Hide;
|
i32 sys_kill(i32, i32, i32) _Hide;
|
||||||
|
@ -133,54 +131,18 @@ i64 sys_readlink(const char *, char *, u64) _Hide;
|
||||||
i64 sys_readlinkat(i32, const char *, char *, u64) _Hide;
|
i64 sys_readlinkat(i32, const char *, char *, u64) _Hide;
|
||||||
i64 sys_sendfile(i32, i32, i64 *, u64) _Hide;
|
i64 sys_sendfile(i32, i32, i64 *, u64) _Hide;
|
||||||
i64 sys_splice(i32, i64 *, i32, i64 *, u64, u32) _Hide;
|
i64 sys_splice(i32, i64 *, i32, i64 *, u64, u32) _Hide;
|
||||||
|
i64 sys_write(i32, const void *, u64) _Hide;
|
||||||
u32 sys_getegid(void) _Hide;
|
u32 sys_getegid(void) _Hide;
|
||||||
u32 sys_geteuid(void) _Hide;
|
u32 sys_geteuid(void) _Hide;
|
||||||
u32 sys_getgid(void) _Hide;
|
u32 sys_getgid(void) _Hide;
|
||||||
u32 sys_getuid(void) _Hide;
|
u32 sys_getuid(void) _Hide;
|
||||||
u32 sys_umask(u32) _Hide;
|
u32 sys_umask(u32) _Hide;
|
||||||
|
unsigned long _sysret(unsigned long) _Hide;
|
||||||
void *__sys_mmap(void *, u64, u32, u32, i64, i64, i64) _Hide;
|
void *__sys_mmap(void *, u64, u32, u32, i64, i64, i64) _Hide;
|
||||||
|
void *__sys_mremap(void *, u64, u64, i32, void *) _Hide;
|
||||||
void *sys_mremap(void *, u64, u64, i32, void *) _Hide;
|
void *sys_mremap(void *, u64, u64, i32, void *) _Hide;
|
||||||
void sys_exit(i32) _Hide;
|
void sys_exit(i32) _Hide;
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
i64 sys_write(i32, const void *, u64) _Hide;
|
|
||||||
#elif defined(__aarch64__)
|
|
||||||
static inline ssize_t sys_write(int f, const void *b, size_t c) {
|
|
||||||
register long r0 asm("x0") = (long)f;
|
|
||||||
register long r1 asm("x1") = (long)b;
|
|
||||||
register long r2 asm("x2") = (long)c;
|
|
||||||
register long res_x0 asm("x0");
|
|
||||||
asm volatile("mov\tx8,%1\n\t"
|
|
||||||
"svc\t0"
|
|
||||||
: "=r"(res_x0)
|
|
||||||
: "i"(64), "r"(r0), "r"(r1), "r"(r2)
|
|
||||||
: "x8", "memory");
|
|
||||||
return _sysret64(res_x0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
i32 sys_ioctl(i32, u64, ...) _Hide;
|
|
||||||
#elif defined(__aarch64__)
|
|
||||||
static inline int sys_ioctl(int d, int r, ...) {
|
|
||||||
void *a;
|
|
||||||
va_list va;
|
|
||||||
va_start(va, r);
|
|
||||||
a = va_arg(va, void *);
|
|
||||||
va_end(va);
|
|
||||||
register long r0 asm("x0") = (long)d;
|
|
||||||
register long r1 asm("x1") = (long)r;
|
|
||||||
register long r2 asm("x2") = (long)a;
|
|
||||||
register long res_x0 asm("x0");
|
|
||||||
asm volatile("mov\tx8,%1\n\t"
|
|
||||||
"svc\t0"
|
|
||||||
: "=r"(res_x0)
|
|
||||||
: "i"(29), "r"(r0), "r"(r1), "r"(r2)
|
|
||||||
: "x8", "memory");
|
|
||||||
return _sysret32(res_x0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef i32
|
#undef i32
|
||||||
#undef i64
|
#undef i64
|
||||||
#undef u32
|
#undef u32
|
||||||
|
|
|
@ -48,6 +48,8 @@
|
||||||
#include "libc/sysv/errfuns.h"
|
#include "libc/sysv/errfuns.h"
|
||||||
#include "libc/thread/tls.h"
|
#include "libc/thread/tls.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
#define OFF(f) offsetof(struct seccomp_data, f)
|
#define OFF(f) offsetof(struct seccomp_data, f)
|
||||||
|
|
||||||
#define UNVEIL_READ \
|
#define UNVEIL_READ \
|
||||||
|
@ -400,3 +402,5 @@ int unveil(const char *path, const char *permissions) {
|
||||||
STRACE("unveil(%#s, %#s) → %d% m", path, permissions, rc);
|
STRACE("unveil(%#s, %#s) → %d% m", path, permissions, rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||||
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||||
│ Copyright 2022 Justine Alexandra Roberts Tunney │
|
│ Copyright 2023 Justine Alexandra Roberts Tunney │
|
||||||
│ │
|
│ │
|
||||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||||
│ any purpose with or without fee is hereby granted, provided that the │
|
│ any purpose with or without fee is hereby granted, provided that the │
|
||||||
|
@ -16,14 +16,9 @@
|
||||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#include "libc/macros.internal.h"
|
#include "libc/runtime/runtime.h"
|
||||||
|
#ifndef __x86_64__
|
||||||
|
|
||||||
.initbss 201,_init_nowl
|
size_t __virtualmax = -1;
|
||||||
nowl: .quad 0
|
|
||||||
.endobj nowl,globl
|
|
||||||
.previous
|
|
||||||
|
|
||||||
.init.start 201,_init_nowl
|
#endif /* __x86_64__ */
|
||||||
ezlea nowl_setup,ax
|
|
||||||
stosq
|
|
||||||
.init.end 201,_init_nowl
|
|
|
@ -45,6 +45,8 @@
|
||||||
#include "libc/sysv/consts/w.h"
|
#include "libc/sysv/consts/w.h"
|
||||||
#include "libc/sysv/errfuns.h"
|
#include "libc/sysv/errfuns.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
static textwindows int sys_wait4_nt_impl(int pid, int *opt_out_wstatus,
|
static textwindows int sys_wait4_nt_impl(int pid, int *opt_out_wstatus,
|
||||||
int options,
|
int options,
|
||||||
struct rusage *opt_out_rusage) {
|
struct rusage *opt_out_rusage) {
|
||||||
|
@ -156,3 +158,5 @@ textwindows int sys_wait4_nt(int pid, int *opt_out_wstatus, int options,
|
||||||
__sig_mask(SIG_SETMASK, &oldmask, 0);
|
__sig_mask(SIG_SETMASK, &oldmask, 0);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include "libc/thread/tls.h"
|
#include "libc/thread/tls.h"
|
||||||
#include "libc/thread/tls2.h"
|
#include "libc/thread/tls2.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
privileged unsigned __wincrash(struct NtExceptionPointers *ep) {
|
privileged unsigned __wincrash(struct NtExceptionPointers *ep) {
|
||||||
int64_t rip;
|
int64_t rip;
|
||||||
int sig, code;
|
int sig, code;
|
||||||
|
@ -147,3 +149,5 @@ privileged unsigned __wincrash(struct NtExceptionPointers *ep) {
|
||||||
|
|
||||||
return kNtExceptionContinueExecution;
|
return kNtExceptionContinueExecution;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
#include "libc/sysv/errfuns.h"
|
#include "libc/sysv/errfuns.h"
|
||||||
#include "libc/vga/vga.internal.h"
|
#include "libc/vga/vga.internal.h"
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
ssize_t sys_writev_metal(struct Fd *fd, const struct iovec *iov, int iovlen) {
|
ssize_t sys_writev_metal(struct Fd *fd, const struct iovec *iov, int iovlen) {
|
||||||
switch (fd->kind) {
|
switch (fd->kind) {
|
||||||
case kFdConsole:
|
case kFdConsole:
|
||||||
|
@ -34,3 +36,5 @@ ssize_t sys_writev_metal(struct Fd *fd, const struct iovec *iov, int iovlen) {
|
||||||
return ebadf();
|
return ebadf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
// @note ape.S and ape-loader both set RCX to XNU on Darwin
|
// @note ape.S and ape-loader both set RCX to XNU on Darwin
|
||||||
// @noreturn
|
// @noreturn
|
||||||
_start:
|
_start:
|
||||||
|
#ifdef __x86_64__
|
||||||
|
|
||||||
#if SupportsXnu()
|
#if SupportsXnu()
|
||||||
// Hack for detecting M1 Rosetta environment.
|
// Hack for detecting M1 Rosetta environment.
|
||||||
|
@ -63,9 +64,9 @@ _start:
|
||||||
mov %edx,4(%rbx)
|
mov %edx,4(%rbx)
|
||||||
|
|
||||||
// translates arguments from old stack abi
|
// translates arguments from old stack abi
|
||||||
mov (%rsp),%ebx # argc
|
mov (%rsp),%ebx // argc
|
||||||
lea 8(%rsp),%rsi # argv
|
lea 8(%rsp),%rsi // argv
|
||||||
lea 16(%rsp,%rbx,8),%rdx # envp
|
lea 16(%rsp,%rbx,8),%rdx // envp
|
||||||
mov %rsp,__oldstack(%rip)
|
mov %rsp,__oldstack(%rip)
|
||||||
and $-16,%rsp
|
and $-16,%rsp
|
||||||
xor %ebp,%ebp
|
xor %ebp,%ebp
|
||||||
|
@ -87,19 +88,33 @@ _start:
|
||||||
or $-1,%ecx
|
or $-1,%ecx
|
||||||
mov %rdx,%rdi
|
mov %rdx,%rdi
|
||||||
repnz scasq
|
repnz scasq
|
||||||
mov %rdi,%rcx # auxv
|
mov %rdi,%rcx // auxv
|
||||||
|
|
||||||
#if SupportsXnu()
|
#if SupportsXnu()
|
||||||
// xnu doesn't have auxiliary values
|
// xnu doesn't have auxiliary values
|
||||||
testb IsXnu()
|
testb IsXnu()
|
||||||
jz 1f # polyfill xnu auxv
|
jz 1f // polyfill xnu auxv
|
||||||
push $0 # auxv[1][1]=0
|
push $0 // auxv[1][1]=0
|
||||||
push $0 # auxv[1][0]=0
|
push $0 // auxv[1][0]=0
|
||||||
mov %rsp,%rcx # auxv
|
mov %rsp,%rcx // auxv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// enter cosmopolitan runtime
|
// enter cosmopolitan runtime
|
||||||
1: mov %ebx,%edi
|
1: mov %ebx,%edi
|
||||||
call cosmo
|
call cosmo
|
||||||
9: .unreachable
|
9: .unreachable
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
|
||||||
|
mov x29,#0
|
||||||
|
mov x30,#0
|
||||||
|
mov x0,sp
|
||||||
|
and sp,x0,#-16
|
||||||
|
b cosmo
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#else
|
||||||
|
#error "architecture unsupported"
|
||||||
|
#endif /* __x86_64__ */
|
||||||
.endfn _start,weak,hidden
|
.endfn _start,weak,hidden
|
||||||
|
|
|
@ -26,5 +26,9 @@ CRT_SRCS = libc/crt/crt.S
|
||||||
CRT_OBJS = o/$(MODE)/libc/crt/crt.o
|
CRT_OBJS = o/$(MODE)/libc/crt/crt.o
|
||||||
$(CRT_OBJS): $(BUILD_FILES) libc/crt/crt.mk
|
$(CRT_OBJS): $(BUILD_FILES) libc/crt/crt.mk
|
||||||
|
|
||||||
|
# these assembly files are safe to build on aarch64
|
||||||
|
o/$(MODE)/libc/crt/crt.o: libc/crt/crt.S
|
||||||
|
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $<
|
||||||
|
|
||||||
.PHONY: o/$(MODE)/libc/crt
|
.PHONY: o/$(MODE)/libc/crt
|
||||||
o/$(MODE)/libc/crt: $(CRT)
|
o/$(MODE)/libc/crt: $(CRT)
|
||||||
|
|
|
@ -5,11 +5,15 @@
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
|
|
||||||
#ifndef SUPPORT_VECTOR
|
#ifndef SUPPORT_VECTOR
|
||||||
|
#ifdef __x86_64__
|
||||||
/**
|
/**
|
||||||
* Supported Platforms Tuning Knob (Runtime & Compile-Time)
|
* Supported Platforms Tuning Knob (Runtime & Compile-Time)
|
||||||
* Tuning this bitmask will remove platform polyfills at compile-time.
|
* Tuning this bitmask will remove platform polyfills at compile-time.
|
||||||
*/
|
*/
|
||||||
#define SUPPORT_VECTOR 255
|
#define SUPPORT_VECTOR 255
|
||||||
|
#else
|
||||||
|
#define SUPPORT_VECTOR _HOSTLINUX
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _HOSTLINUX 1
|
#define _HOSTLINUX 1
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
#define EM_NONE 0
|
#define EM_NONE 0
|
||||||
#define EM_M32 1
|
#define EM_M32 1
|
||||||
#define EM_386 3
|
#define EM_386 3
|
||||||
|
#define EM_PPC64 21
|
||||||
#define EM_S390 22
|
#define EM_S390 22
|
||||||
#define EM_ARM 40
|
#define EM_ARM 40
|
||||||
#define EM_NEXGEN32E 62
|
#define EM_NEXGEN32E 62
|
||||||
|
|
|
@ -19,13 +19,9 @@
|
||||||
#include "libc/fmt/magnumstrs.internal.h"
|
#include "libc/fmt/magnumstrs.internal.h"
|
||||||
#include "libc/intrin/describeflags.internal.h"
|
#include "libc/intrin/describeflags.internal.h"
|
||||||
|
|
||||||
#ifdef DescribeClockName
|
|
||||||
#undef DescribeClockName
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes clock_gettime() clock argument.
|
* Describes clock_gettime() clock argument.
|
||||||
*/
|
*/
|
||||||
const char *DescribeClockName(char buf[32], int x) {
|
const char *(DescribeClockName)(char buf[32], int x) {
|
||||||
return DescribeMagnum(buf, kClockNames, "CLOCK_", x);
|
return DescribeMagnum(buf, kClockNames, "CLOCK_", x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
#include "libc/nt/enum/processaccess.h"
|
#include "libc/nt/enum/processaccess.h"
|
||||||
#include "libc/sysv/consts/dn.h"
|
#include "libc/sysv/consts/dn.h"
|
||||||
|
|
||||||
#ifdef DescribeDnotifyFlags
|
|
||||||
#undef DescribeDnotifyFlags
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct DescribeFlags kDnotifyFlags[] = {
|
static const struct DescribeFlags kDnotifyFlags[] = {
|
||||||
{DN_ACCESS, "ACCESS"}, //
|
{DN_ACCESS, "ACCESS"}, //
|
||||||
{DN_MODIFY, "MODIFY"}, //
|
{DN_MODIFY, "MODIFY"}, //
|
||||||
|
@ -35,7 +31,7 @@ static const struct DescribeFlags kDnotifyFlags[] = {
|
||||||
{DN_MULTISHOT, "MULTISHOT"}, //
|
{DN_MULTISHOT, "MULTISHOT"}, //
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *DescribeDnotifyFlags(char buf[80], int x) {
|
const char *(DescribeDnotifyFlags)(char buf[80], int x) {
|
||||||
return DescribeFlags(buf, 80, kDnotifyFlags, ARRAYLEN(kDnotifyFlags), "DN_",
|
return DescribeFlags(buf, 80, kDnotifyFlags, ARRAYLEN(kDnotifyFlags), "DN_",
|
||||||
x);
|
x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
#include "libc/intrin/describeflags.internal.h"
|
#include "libc/intrin/describeflags.internal.h"
|
||||||
#include "libc/str/str.h"
|
#include "libc/str/str.h"
|
||||||
|
|
||||||
#ifdef DescribeErrno
|
const char *(DescribeErrno)(char buf[20], int ax) {
|
||||||
#undef DescribeErrno
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *DescribeErrno(char buf[20], int ax) {
|
|
||||||
char *p = buf;
|
char *p = buf;
|
||||||
const char *s;
|
const char *s;
|
||||||
if (ax < 0) {
|
if (ax < 0) {
|
||||||
|
|
|
@ -19,11 +19,7 @@
|
||||||
#include "libc/fmt/itoa.h"
|
#include "libc/fmt/itoa.h"
|
||||||
#include "libc/sysv/consts/f.h"
|
#include "libc/sysv/consts/f.h"
|
||||||
|
|
||||||
#ifdef DescribeFlockType
|
const char *(DescribeFlockType)(char buf[12], int x) {
|
||||||
#undef DescribeFlockType
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *DescribeFlockType(char buf[12], int x) {
|
|
||||||
if (x == F_RDLCK) return "F_RDLCK";
|
if (x == F_RDLCK) return "F_RDLCK";
|
||||||
if (x == F_WRLCK) return "F_WRLCK";
|
if (x == F_WRLCK) return "F_WRLCK";
|
||||||
if (x == F_UNLCK) return "F_UNLCK";
|
if (x == F_UNLCK) return "F_UNLCK";
|
||||||
|
|
|
@ -21,11 +21,7 @@
|
||||||
#include "libc/str/str.h"
|
#include "libc/str/str.h"
|
||||||
#include "libc/sysv/consts/futex.h"
|
#include "libc/sysv/consts/futex.h"
|
||||||
|
|
||||||
#ifdef DescribeFutexOp
|
const char *(DescribeFutexOp)(char buf[64], int x) {
|
||||||
#undef DescribeFutexOp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *DescribeFutexOp(char buf[64], int x) {
|
|
||||||
|
|
||||||
bool priv = false;
|
bool priv = false;
|
||||||
if (x & FUTEX_PRIVATE_FLAG) {
|
if (x & FUTEX_PRIVATE_FLAG) {
|
||||||
|
|
|
@ -22,11 +22,7 @@
|
||||||
#include "libc/sysv/consts/map.h"
|
#include "libc/sysv/consts/map.h"
|
||||||
#include "libc/sysv/consts/prot.h"
|
#include "libc/sysv/consts/prot.h"
|
||||||
|
|
||||||
#ifdef DescribeMapFlags
|
const char *(DescribeMapFlags)(char buf[64], int x) {
|
||||||
#undef DescribeMapFlags
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *DescribeMapFlags(char buf[64], int x) {
|
|
||||||
const struct DescribeFlags kMapFlags[] = {
|
const struct DescribeFlags kMapFlags[] = {
|
||||||
{MAP_STACK, "STACK"}, // order matters
|
{MAP_STACK, "STACK"}, // order matters
|
||||||
{MAP_PRIVATE, "PRIVATE"}, //
|
{MAP_PRIVATE, "PRIVATE"}, //
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
#include "libc/nt/enum/accessmask.h"
|
#include "libc/nt/enum/accessmask.h"
|
||||||
#include "libc/nt/enum/filesharemode.h"
|
#include "libc/nt/enum/filesharemode.h"
|
||||||
|
|
||||||
#ifdef DescribeNtFileAccessFlags
|
|
||||||
#undef DescribeNtFileAccessFlags
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct DescribeFlags kFileAccessflags[] = {
|
static const struct DescribeFlags kFileAccessflags[] = {
|
||||||
{kNtFileAllAccess, "FileAllAccess"}, // order matters
|
{kNtFileAllAccess, "FileAllAccess"}, // order matters
|
||||||
{kNtFileGenericRead, "FileGenericRead"}, // order matters
|
{kNtFileGenericRead, "FileGenericRead"}, // order matters
|
||||||
|
@ -67,7 +63,7 @@ static const struct DescribeFlags kFileAccessflags[] = {
|
||||||
{kNtTokenAdjustSessionid, "TokenAdjustSessionid"}, //
|
{kNtTokenAdjustSessionid, "TokenAdjustSessionid"}, //
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *DescribeNtFileAccessFlags(char buf[512], uint32_t x) {
|
const char *(DescribeNtFileAccessFlags)(char buf[512], uint32_t x) {
|
||||||
return DescribeFlags(buf, 512, kFileAccessflags, ARRAYLEN(kFileAccessflags),
|
return DescribeFlags(buf, 512, kFileAccessflags, ARRAYLEN(kFileAccessflags),
|
||||||
"kNt", x);
|
"kNt", x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
#include "libc/nt/enum/filemapflags.h"
|
#include "libc/nt/enum/filemapflags.h"
|
||||||
#include "libc/nt/ipc.h"
|
#include "libc/nt/ipc.h"
|
||||||
|
|
||||||
#ifdef DescribeNtPipeModeFlags
|
|
||||||
#undef DescribeNtPipeModeFlags
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct DescribeFlags kPipeModeFlags[] = {
|
static const struct DescribeFlags kPipeModeFlags[] = {
|
||||||
{kNtPipeNowait, "Nowait"}, // 0x0000000001
|
{kNtPipeNowait, "Nowait"}, // 0x0000000001
|
||||||
{kNtPipeReadmodeMessage, "ReadmodeMessage"}, // 0x0000000002
|
{kNtPipeReadmodeMessage, "ReadmodeMessage"}, // 0x0000000002
|
||||||
|
@ -36,7 +32,7 @@ static const struct DescribeFlags kPipeModeFlags[] = {
|
||||||
//{kNtPipeTypeByte, "TypeByte"}, // 0x00000000
|
//{kNtPipeTypeByte, "TypeByte"}, // 0x00000000
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *DescribeNtPipeModeFlags(char buf[64], uint32_t x) {
|
const char *(DescribeNtPipeModeFlags)(char buf[64], uint32_t x) {
|
||||||
return DescribeFlags(buf, 64, kPipeModeFlags, ARRAYLEN(kPipeModeFlags),
|
return DescribeFlags(buf, 64, kPipeModeFlags, ARRAYLEN(kPipeModeFlags),
|
||||||
"kNtPipe", x);
|
"kNtPipe", x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,16 +23,12 @@
|
||||||
#include "libc/macros.internal.h"
|
#include "libc/macros.internal.h"
|
||||||
#include "libc/sysv/consts/sol.h"
|
#include "libc/sysv/consts/sol.h"
|
||||||
|
|
||||||
#ifdef DescribeOpenFlags
|
|
||||||
#undef DescribeOpenFlags
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define N (PAGESIZE / 2 / sizeof(struct DescribeFlags))
|
#define N (PAGESIZE / 2 / sizeof(struct DescribeFlags))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes clock_gettime() clock argument.
|
* Describes clock_gettime() clock argument.
|
||||||
*/
|
*/
|
||||||
const char *DescribeOpenFlags(char buf[128], int x) {
|
const char *(DescribeOpenFlags)(char buf[128], int x) {
|
||||||
char *s;
|
char *s;
|
||||||
int i, n;
|
int i, n;
|
||||||
struct DescribeFlags d[N];
|
struct DescribeFlags d[N];
|
||||||
|
|
|
@ -21,14 +21,10 @@
|
||||||
#include "libc/intrin/describeflags.internal.h"
|
#include "libc/intrin/describeflags.internal.h"
|
||||||
#include "libc/str/str.h"
|
#include "libc/str/str.h"
|
||||||
|
|
||||||
#ifdef DescribeSchedParam
|
|
||||||
#undef DescribeSchedParam
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes clock_gettime() clock argument.
|
* Describes clock_gettime() clock argument.
|
||||||
*/
|
*/
|
||||||
const char *DescribeSchedParam(char buf[32], const struct sched_param *x) {
|
const char *(DescribeSchedParam)(char buf[32], const struct sched_param *x) {
|
||||||
char *p;
|
char *p;
|
||||||
if (!x) return "0";
|
if (!x) return "0";
|
||||||
p = buf;
|
p = buf;
|
||||||
|
|
|
@ -26,15 +26,11 @@
|
||||||
#include "libc/str/str.h"
|
#include "libc/str/str.h"
|
||||||
#include "libc/sysv/consts/sig.h"
|
#include "libc/sysv/consts/sig.h"
|
||||||
|
|
||||||
#ifdef DescribeSiginfo
|
|
||||||
#undef DescribeSiginfo
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define N 300
|
#define N 300
|
||||||
|
|
||||||
#define append(...) i += ksnprintf(buf + i, N - i, __VA_ARGS__)
|
#define append(...) i += ksnprintf(buf + i, N - i, __VA_ARGS__)
|
||||||
|
|
||||||
const char *DescribeSiginfo(char buf[N], int rc, const siginfo_t *si) {
|
const char *(DescribeSiginfo)(char buf[N], int rc, const siginfo_t *si) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
if (rc == -1) return "n/a";
|
if (rc == -1) return "n/a";
|
||||||
|
|
|
@ -26,15 +26,11 @@
|
||||||
#include "libc/sysv/consts/limits.h"
|
#include "libc/sysv/consts/limits.h"
|
||||||
#include "libc/sysv/consts/sig.h"
|
#include "libc/sysv/consts/sig.h"
|
||||||
|
|
||||||
#ifdef DescribeSigset
|
|
||||||
#undef DescribeSigset
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define N 128
|
#define N 128
|
||||||
|
|
||||||
#define append(...) o += ksnprintf(buf + o, N - o, __VA_ARGS__)
|
#define append(...) o += ksnprintf(buf + o, N - o, __VA_ARGS__)
|
||||||
|
|
||||||
const char *DescribeSigset(char buf[N], int rc, const sigset_t *ss) {
|
const char *(DescribeSigset)(char buf[N], int rc, const sigset_t *ss) {
|
||||||
bool gotsome;
|
bool gotsome;
|
||||||
const char *s;
|
const char *s;
|
||||||
int sig, o = 0;
|
int sig, o = 0;
|
||||||
|
|
|
@ -21,14 +21,10 @@
|
||||||
#include "libc/intrin/describeflags.internal.h"
|
#include "libc/intrin/describeflags.internal.h"
|
||||||
#include "libc/sysv/consts/timer.h"
|
#include "libc/sysv/consts/timer.h"
|
||||||
|
|
||||||
#ifdef DescribeSleepFlags
|
|
||||||
#undef DescribeSleepFlags
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes clock_nanosleep() flags argument.
|
* Describes clock_nanosleep() flags argument.
|
||||||
*/
|
*/
|
||||||
const char *DescribeSleepFlags(char buf[16], int x) {
|
const char *(DescribeSleepFlags)(char buf[16], int x) {
|
||||||
switch (x) {
|
switch (x) {
|
||||||
case 0:
|
case 0:
|
||||||
return "0";
|
return "0";
|
||||||
|
|
|
@ -22,15 +22,11 @@
|
||||||
#include "libc/intrin/asan.internal.h"
|
#include "libc/intrin/asan.internal.h"
|
||||||
#include "libc/intrin/kprintf.h"
|
#include "libc/intrin/kprintf.h"
|
||||||
|
|
||||||
#ifdef DescribeStat
|
|
||||||
#undef DescribeStat
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define N 300
|
#define N 300
|
||||||
|
|
||||||
#define append(...) o += ksnprintf(buf + o, N - o, __VA_ARGS__)
|
#define append(...) o += ksnprintf(buf + o, N - o, __VA_ARGS__)
|
||||||
|
|
||||||
const char *DescribeStat(char buf[N], int rc, const struct stat *st) {
|
const char *(DescribeStat)(char buf[N], int rc, const struct stat *st) {
|
||||||
int o = 0;
|
int o = 0;
|
||||||
|
|
||||||
if (rc == -1) return "n/a";
|
if (rc == -1) return "n/a";
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
#include "libc/fmt/itoa.h"
|
#include "libc/fmt/itoa.h"
|
||||||
#include "libc/intrin/describeflags.internal.h"
|
#include "libc/intrin/describeflags.internal.h"
|
||||||
|
|
||||||
#ifdef DescribeWhence
|
const char *(DescribeWhence)(char buf[12], int whence) {
|
||||||
#undef DescribeWhence
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *DescribeWhence(char buf[12], int whence) {
|
|
||||||
if (whence == SEEK_SET) return "SEEK_SET";
|
if (whence == SEEK_SET) return "SEEK_SET";
|
||||||
if (whence == SEEK_CUR) return "SEEK_CUR";
|
if (whence == SEEK_CUR) return "SEEK_CUR";
|
||||||
if (whence == SEEK_END) return "SEEK_END";
|
if (whence == SEEK_END) return "SEEK_END";
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
#include "libc/intrin/describeflags.internal.h"
|
#include "libc/intrin/describeflags.internal.h"
|
||||||
#include "libc/sysv/consts/prio.h"
|
#include "libc/sysv/consts/prio.h"
|
||||||
|
|
||||||
#ifdef DescribeWhichPrio
|
const char *(DescribeWhichPrio)(char buf[12], int x) {
|
||||||
#undef DescribeWhichPrio
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *DescribeWhichPrio(char buf[12], int x) {
|
|
||||||
if (x == PRIO_PROCESS) return "PRIO_PROCESS";
|
if (x == PRIO_PROCESS) return "PRIO_PROCESS";
|
||||||
if (x == PRIO_PGRP) return "PRIO_PGRP";
|
if (x == PRIO_PGRP) return "PRIO_PGRP";
|
||||||
if (x == PRIO_USER) return "PRIO_USER";
|
if (x == PRIO_USER) return "PRIO_USER";
|
||||||
|
|
|
@ -157,7 +157,7 @@ void *memset(void *p, int c, size_t n) {
|
||||||
} while (n);
|
} while (n);
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
#ifdef __x86_64__
|
#ifdef __x86__
|
||||||
} else if (IsTiny()) {
|
} else if (IsTiny()) {
|
||||||
asm("rep stosb" : "+D"(b), "+c"(n), "=m"(*(char(*)[n])b) : "0"(p), "a"(c));
|
asm("rep stosb" : "+D"(b), "+c"(n), "=m"(*(char(*)[n])b) : "0"(p), "a"(c));
|
||||||
return p;
|
return p;
|
||||||
|
|
|
@ -18,17 +18,13 @@
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#include "libc/intrin/psrad.h"
|
#include "libc/intrin/psrad.h"
|
||||||
|
|
||||||
#ifdef psradv
|
|
||||||
#undef psradv
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Divides shorts by two powers.
|
* Divides shorts by two powers.
|
||||||
*
|
*
|
||||||
* @note arithmetic shift right will sign extend negatives
|
* @note arithmetic shift right will sign extend negatives
|
||||||
* @mayalias
|
* @mayalias
|
||||||
*/
|
*/
|
||||||
void psradv(int32_t a[4], const int32_t b[4], const uint64_t c[2]) {
|
void(psradv)(int32_t a[4], const int32_t b[4], const uint64_t c[2]) {
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unsigned char k;
|
unsigned char k;
|
||||||
k = c[0] > 31 ? 31 : c[0];
|
k = c[0] > 31 ? 31 : c[0];
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
#include "libc/macros.internal.h"
|
#include "libc/macros.internal.h"
|
||||||
#include "libc/str/str.h"
|
#include "libc/str/str.h"
|
||||||
|
|
||||||
#ifdef psubusb
|
|
||||||
#undef psubusb
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subtracts unsigned 8-bit integers w/ saturation.
|
* Subtracts unsigned 8-bit integers w/ saturation.
|
||||||
*
|
*
|
||||||
|
@ -33,7 +29,7 @@
|
||||||
* @param 𝑐 [r/o] supplies second input vector
|
* @param 𝑐 [r/o] supplies second input vector
|
||||||
* @mayalias
|
* @mayalias
|
||||||
*/
|
*/
|
||||||
void psubusb(uint8_t a[16], const uint8_t b[16], const uint8_t c[16]) {
|
void(psubusb)(uint8_t a[16], const uint8_t b[16], const uint8_t c[16]) {
|
||||||
unsigned i;
|
unsigned i;
|
||||||
uint8_t r[16];
|
uint8_t r[16];
|
||||||
for (i = 0; i < 16; ++i) {
|
for (i = 0; i < 16; ++i) {
|
||||||
|
|
|
@ -21,11 +21,7 @@
|
||||||
#include "libc/thread/thread.h"
|
#include "libc/thread/thread.h"
|
||||||
#include "libc/thread/tls.h"
|
#include "libc/thread/tls.h"
|
||||||
|
|
||||||
#ifdef pthread_cleanup_pop
|
void(pthread_cleanup_pop)(struct _pthread_cleanup_buffer *cb, int execute) {
|
||||||
#undef pthread_cleanup_pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void pthread_cleanup_pop(struct _pthread_cleanup_buffer *cb, int execute) {
|
|
||||||
struct PosixThread *pt;
|
struct PosixThread *pt;
|
||||||
if (__tls_enabled && (pt = (struct PosixThread *)__get_tls()->tib_pthread)) {
|
if (__tls_enabled && (pt = (struct PosixThread *)__get_tls()->tib_pthread)) {
|
||||||
_unassert(cb == pt->cleanup);
|
_unassert(cb == pt->cleanup);
|
||||||
|
|
|
@ -20,12 +20,8 @@
|
||||||
#include "libc/thread/thread.h"
|
#include "libc/thread/thread.h"
|
||||||
#include "libc/thread/tls.h"
|
#include "libc/thread/tls.h"
|
||||||
|
|
||||||
#ifdef pthread_cleanup_push
|
void(pthread_cleanup_push)(struct _pthread_cleanup_buffer *cb,
|
||||||
#undef pthread_cleanup_push
|
void (*routine)(void *), void *arg) {
|
||||||
#endif
|
|
||||||
|
|
||||||
void pthread_cleanup_push(struct _pthread_cleanup_buffer *cb,
|
|
||||||
void (*routine)(void *), void *arg) {
|
|
||||||
struct PosixThread *pt;
|
struct PosixThread *pt;
|
||||||
cb->__routine = routine;
|
cb->__routine = routine;
|
||||||
cb->__arg = arg;
|
cb->__arg = arg;
|
||||||
|
|
|
@ -19,10 +19,6 @@
|
||||||
#include "libc/intrin/atomic.h"
|
#include "libc/intrin/atomic.h"
|
||||||
#include "libc/thread/thread.h"
|
#include "libc/thread/thread.h"
|
||||||
|
|
||||||
#ifdef pthread_spin_init
|
|
||||||
#undef pthread_spin_init
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes spin lock.
|
* Initializes spin lock.
|
||||||
*
|
*
|
||||||
|
@ -32,7 +28,7 @@
|
||||||
* @see pthread_spin_destroy
|
* @see pthread_spin_destroy
|
||||||
* @see pthread_spin_lock
|
* @see pthread_spin_lock
|
||||||
*/
|
*/
|
||||||
errno_t pthread_spin_init(pthread_spinlock_t *spin, int pshared) {
|
errno_t(pthread_spin_init)(pthread_spinlock_t *spin, int pshared) {
|
||||||
atomic_store_explicit(&spin->_lock, 0, memory_order_relaxed);
|
atomic_store_explicit(&spin->_lock, 0, memory_order_relaxed);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
#include "libc/intrin/strace.internal.h"
|
#include "libc/intrin/strace.internal.h"
|
||||||
#include "libc/thread/thread.h"
|
#include "libc/thread/thread.h"
|
||||||
|
|
||||||
#ifdef pthread_spin_lock
|
|
||||||
#undef pthread_spin_lock
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acquires spin lock, e.g.
|
* Acquires spin lock, e.g.
|
||||||
*
|
*
|
||||||
|
@ -43,7 +39,7 @@
|
||||||
* @see pthread_spin_unlock
|
* @see pthread_spin_unlock
|
||||||
* @see pthread_spin_init
|
* @see pthread_spin_init
|
||||||
*/
|
*/
|
||||||
errno_t pthread_spin_lock(pthread_spinlock_t *spin) {
|
errno_t(pthread_spin_lock)(pthread_spinlock_t *spin) {
|
||||||
int x;
|
int x;
|
||||||
#if defined(SYSDEBUG) && _LOCKTRACE
|
#if defined(SYSDEBUG) && _LOCKTRACE
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
|
@ -164,6 +164,17 @@
|
||||||
.previous
|
.previous
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
// Documents unreachable assembly code.
|
||||||
|
.macro .unreachable
|
||||||
|
#if !defined(NDEBUG) && defined(__x86_64__)
|
||||||
|
ud2 // crash if contract is broken
|
||||||
|
#elif !defined(NDEBUG) && defined(__aarch64__)
|
||||||
|
brk #1000
|
||||||
|
#elif defined(__FNO_OMIT_FRAME_POINTER__)
|
||||||
|
nop // avoid noreturn tail call backtrace ambiguity
|
||||||
|
#endif
|
||||||
|
.endm
|
||||||
|
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
|
|
||||||
#if __MNO_VZEROUPPER__ + 0
|
#if __MNO_VZEROUPPER__ + 0
|
||||||
|
@ -447,15 +458,6 @@
|
||||||
#endif
|
#endif
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
// Documents unreachable assembly code.
|
|
||||||
.macro .unreachable
|
|
||||||
#ifndef NDEBUG
|
|
||||||
ud2 # crash if contract is broken
|
|
||||||
#elif defined(__FNO_OMIT_FRAME_POINTER__)
|
|
||||||
nop # avoid noreturn tail call backtrace ambiguity
|
|
||||||
#endif
|
|
||||||
.endm
|
|
||||||
|
|
||||||
// Inserts profiling hook in prologue if cc wants it.
|
// Inserts profiling hook in prologue if cc wants it.
|
||||||
//
|
//
|
||||||
// Cosmopolitan does this in a slightly different way from normal
|
// Cosmopolitan does this in a slightly different way from normal
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||||
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||||
│ Copyright 2022 Justine Alexandra Roberts Tunney │
|
│ Copyright 2023 Justine Alexandra Roberts Tunney │
|
||||||
│ │
|
│ │
|
||||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||||
│ any purpose with or without fee is hereby granted, provided that the │
|
│ any purpose with or without fee is hereby granted, provided that the │
|
||||||
|
@ -16,15 +16,9 @@
|
||||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#include "libc/macros.internal.h"
|
#include "libc/runtime/runtime.h"
|
||||||
|
#ifndef __x86_64__
|
||||||
|
|
||||||
.initbss 301,_init___gettimeofday
|
int __argc;
|
||||||
__gettimeofday:
|
|
||||||
.quad 0
|
|
||||||
.endobj __gettimeofday,globl,hidden
|
|
||||||
.previous
|
|
||||||
|
|
||||||
.init.start 301,_init___gettimeofday
|
#endif /* __x86_64__ */
|
||||||
ezlea __gettimeofday_init,ax
|
|
||||||
stosq
|
|
||||||
.init.end 301,_init___gettimeofday
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||||
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||||
│ Copyright 2022 Justine Alexandra Roberts Tunney │
|
│ Copyright 2023 Justine Alexandra Roberts Tunney │
|
||||||
│ │
|
│ │
|
||||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||||
│ any purpose with or without fee is hereby granted, provided that the │
|
│ any purpose with or without fee is hereby granted, provided that the │
|
||||||
|
@ -16,15 +16,9 @@
|
||||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#include "libc/macros.internal.h"
|
#include "libc/runtime/runtime.h"
|
||||||
|
#ifndef __x86_64__
|
||||||
|
|
||||||
.initbss 301,_init___clock_gettime
|
char **__argv;
|
||||||
__clock_gettime:
|
|
||||||
.quad 0
|
|
||||||
.endobj __clock_gettime,globl,hidden
|
|
||||||
.previous
|
|
||||||
|
|
||||||
.init.start 301,_init___clock_gettime
|
#endif /* __x86_64__ */
|
||||||
ezlea __clock_gettime_init,ax
|
|
||||||
stosq
|
|
||||||
.init.end 301,_init___clock_gettime
|
|
|
@ -17,7 +17,8 @@
|
||||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
#include "libc/runtime/runtime.h"
|
#include "libc/runtime/runtime.h"
|
||||||
|
#ifndef __x86_64__
|
||||||
|
|
||||||
#ifdef __aarch64__
|
|
||||||
char **environ;
|
char **environ;
|
||||||
#endif
|
|
||||||
|
#endif /* __x86_64__ */
|
||||||
|
|
24
libc/nexgen32e/envp2.c
Normal file
24
libc/nexgen32e/envp2.c
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||||
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||||
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||||
|
│ Copyright 2023 Justine Alexandra Roberts Tunney │
|
||||||
|
│ │
|
||||||
|
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||||
|
│ any purpose with or without fee is hereby granted, provided that the │
|
||||||
|
│ above copyright notice and this permission notice appear in all copies. │
|
||||||
|
│ │
|
||||||
|
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||||
|
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||||
|
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||||
|
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||||
|
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||||
|
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||||
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||||
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
|
#include "libc/runtime/runtime.h"
|
||||||
|
#ifndef __x86_64__
|
||||||
|
|
||||||
|
char **__envp;
|
||||||
|
|
||||||
|
#endif /* __x86_64__ */
|
21
libc/nexgen32e/program_invocation_name2.c
Normal file
21
libc/nexgen32e/program_invocation_name2.c
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||||
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||||
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||||
|
│ Copyright 2023 Justine Alexandra Roberts Tunney │
|
||||||
|
│ │
|
||||||
|
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||||
|
│ any purpose with or without fee is hereby granted, provided that the │
|
||||||
|
│ above copyright notice and this permission notice appear in all copies. │
|
||||||
|
│ │
|
||||||
|
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||||
|
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||||
|
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||||
|
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||||
|
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||||
|
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||||
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||||
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||||
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
|
#include "libc/runtime/runtime.h"
|
||||||
|
|
||||||
|
char *program_invocation_name;
|
|
@ -39,7 +39,6 @@ setjmp:
|
||||||
mov (%rsp),%rax
|
mov (%rsp),%rax
|
||||||
mov %rax,56(%rdi)
|
mov %rax,56(%rdi)
|
||||||
xor %eax,%eax
|
xor %eax,%eax
|
||||||
ret
|
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
stp x19,x20,[x0,#0]
|
stp x19,x20,[x0,#0]
|
||||||
stp x21,x22,[x0,#16]
|
stp x21,x22,[x0,#16]
|
||||||
|
@ -54,7 +53,7 @@ setjmp:
|
||||||
stp d12,d13,[x0,#144]
|
stp d12,d13,[x0,#144]
|
||||||
stp d14,d15,[x0,#160]
|
stp d14,d15,[x0,#160]
|
||||||
mov x0,#0
|
mov x0,#0
|
||||||
ret
|
|
||||||
#endif
|
#endif
|
||||||
|
ret
|
||||||
.endfn setjmp,globl
|
.endfn setjmp,globl
|
||||||
.alias setjmp,_setjmp
|
.alias setjmp,_setjmp
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WaitOnAddress,WaitOnAddress,111
|
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WaitOnAddress,WaitOnAddress,111
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
WaitOnAddress:
|
WaitOnAddress:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_WaitOnAddress(%rip),%rax
|
mov __imp_WaitOnAddress(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn WaitOnAddress,globl
|
.endfn WaitOnAddress,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WakeByAddressAll,WakeByAddressAll,113
|
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WakeByAddressAll,WakeByAddressAll,113
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
WakeByAddressAll:
|
WakeByAddressAll:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
|
@ -11,7 +11,9 @@ WakeByAddressAll:
|
||||||
sub $32,%rsp
|
sub $32,%rsp
|
||||||
call *__imp_WakeByAddressAll(%rip)
|
call *__imp_WakeByAddressAll(%rip)
|
||||||
leave
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
.endfn WakeByAddressAll,globl
|
.endfn WakeByAddressAll,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WakeByAddressSingle,WakeByAddressSingle,116
|
.imp API-MS-Win-Core-Synch-l1-2-0,__imp_WakeByAddressSingle,WakeByAddressSingle,116
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
WakeByAddressSingle:
|
WakeByAddressSingle:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
|
@ -11,7 +11,9 @@ WakeByAddressSingle:
|
||||||
sub $32,%rsp
|
sub $32,%rsp
|
||||||
call *__imp_WakeByAddressSingle(%rip)
|
call *__imp_WakeByAddressSingle(%rip)
|
||||||
leave
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
.endfn WakeByAddressSingle,globl
|
.endfn WakeByAddressSingle,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp MsWSock,__imp_AcceptEx,AcceptEx,0
|
.imp MsWSock,__imp_AcceptEx,AcceptEx,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
AcceptEx:
|
AcceptEx:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_AcceptEx(%rip),%rax
|
mov __imp_AcceptEx(%rip),%rax
|
||||||
jmp __sysv2nt8
|
jmp __sysv2nt8
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn AcceptEx,globl
|
.endfn AcceptEx,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp MsWSock,__imp_DisconnectEx,DisconnectEx,0
|
.imp MsWSock,__imp_DisconnectEx,DisconnectEx,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
DisconnectEx:
|
DisconnectEx:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_DisconnectEx(%rip),%rax
|
mov __imp_DisconnectEx(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn DisconnectEx,globl
|
.endfn DisconnectEx,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp MsWSock,__imp_GetAcceptExSockaddrs,GetAcceptExSockaddrs,0
|
.imp MsWSock,__imp_GetAcceptExSockaddrs,GetAcceptExSockaddrs,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
GetAcceptExSockaddrs:
|
GetAcceptExSockaddrs:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_GetAcceptExSockaddrs(%rip),%rax
|
mov __imp_GetAcceptExSockaddrs(%rip),%rax
|
||||||
jmp __sysv2nt8
|
jmp __sysv2nt8
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn GetAcceptExSockaddrs,globl
|
.endfn GetAcceptExSockaddrs,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp MsWSock,__imp_TransmitFile,TransmitFile,0
|
.imp MsWSock,__imp_TransmitFile,TransmitFile,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
TransmitFile:
|
TransmitFile:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_TransmitFile(%rip),%rax
|
mov __imp_TransmitFile(%rip),%rax
|
||||||
jmp __sysv2nt8
|
jmp __sysv2nt8
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn TransmitFile,globl
|
.endfn TransmitFile,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp MsWSock,__imp_WSARecvEx,WSARecvEx,0
|
.imp MsWSock,__imp_WSARecvEx,WSARecvEx,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
WSARecvEx:
|
WSARecvEx:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_WSARecvEx(%rip),%rax
|
mov __imp_WSARecvEx(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn WSARecvEx,globl
|
.endfn WSARecvEx,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp PowrProf,__imp_SetSuspendState,SetSuspendState,0
|
.imp PowrProf,__imp_SetSuspendState,SetSuspendState,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
SetSuspendState:
|
SetSuspendState:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_SetSuspendState(%rip),%rax
|
mov __imp_SetSuspendState(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn SetSuspendState,globl
|
.endfn SetSuspendState,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_AccessCheck,AccessCheck,0
|
.imp advapi32,__imp_AccessCheck,AccessCheck,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
AccessCheck:
|
AccessCheck:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_AccessCheck(%rip),%rax
|
mov __imp_AccessCheck(%rip),%rax
|
||||||
jmp __sysv2nt8
|
jmp __sysv2nt8
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn AccessCheck,globl
|
.endfn AccessCheck,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_AdjustTokenPrivileges,AdjustTokenPrivileges,0
|
.imp advapi32,__imp_AdjustTokenPrivileges,AdjustTokenPrivileges,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
AdjustTokenPrivileges:
|
AdjustTokenPrivileges:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_AdjustTokenPrivileges(%rip),%rax
|
mov __imp_AdjustTokenPrivileges(%rip),%rax
|
||||||
jmp __sysv2nt6
|
jmp __sysv2nt6
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn AdjustTokenPrivileges,globl
|
.endfn AdjustTokenPrivileges,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_CreateProcessAsUserW,CreateProcessAsUserW,0
|
.imp advapi32,__imp_CreateProcessAsUserW,CreateProcessAsUserW,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
CreateProcessAsUser:
|
CreateProcessAsUser:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_CreateProcessAsUserW(%rip),%rax
|
mov __imp_CreateProcessAsUserW(%rip),%rax
|
||||||
jmp __sysv2nt12
|
jmp __sysv2nt12
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn CreateProcessAsUser,globl
|
.endfn CreateProcessAsUser,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_DeregisterEventSource,DeregisterEventSource,1239
|
.imp advapi32,__imp_DeregisterEventSource,DeregisterEventSource,1239
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
DeregisterEventSource:
|
DeregisterEventSource:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
|
@ -11,7 +11,9 @@ DeregisterEventSource:
|
||||||
sub $32,%rsp
|
sub $32,%rsp
|
||||||
call *__imp_DeregisterEventSource(%rip)
|
call *__imp_DeregisterEventSource(%rip)
|
||||||
leave
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
.endfn DeregisterEventSource,globl
|
.endfn DeregisterEventSource,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_DuplicateToken,DuplicateToken,0
|
.imp advapi32,__imp_DuplicateToken,DuplicateToken,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
DuplicateToken:
|
DuplicateToken:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_DuplicateToken(%rip),%rax
|
mov __imp_DuplicateToken(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn DuplicateToken,globl
|
.endfn DuplicateToken,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_DuplicateTokenEx,DuplicateTokenEx,0
|
.imp advapi32,__imp_DuplicateTokenEx,DuplicateTokenEx,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
DuplicateTokenEx:
|
DuplicateTokenEx:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_DuplicateTokenEx(%rip),%rax
|
mov __imp_DuplicateTokenEx(%rip),%rax
|
||||||
jmp __sysv2nt6
|
jmp __sysv2nt6
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn DuplicateTokenEx,globl
|
.endfn DuplicateTokenEx,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_GetFileSecurityW,GetFileSecurityW,0
|
.imp advapi32,__imp_GetFileSecurityW,GetFileSecurityW,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
GetFileSecurity:
|
GetFileSecurity:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_GetFileSecurityW(%rip),%rax
|
mov __imp_GetFileSecurityW(%rip),%rax
|
||||||
jmp __sysv2nt6
|
jmp __sysv2nt6
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn GetFileSecurity,globl
|
.endfn GetFileSecurity,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_GetUserNameW,GetUserNameW,1381
|
.imp advapi32,__imp_GetUserNameW,GetUserNameW,1381
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
GetUserName:
|
GetUserName:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_GetUserNameW(%rip),%rax
|
mov __imp_GetUserNameW(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn GetUserName,globl
|
.endfn GetUserName,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_ImpersonateSelf,ImpersonateSelf,0
|
.imp advapi32,__imp_ImpersonateSelf,ImpersonateSelf,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
ImpersonateSelf:
|
ImpersonateSelf:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
|
@ -11,7 +11,9 @@ ImpersonateSelf:
|
||||||
sub $32,%rsp
|
sub $32,%rsp
|
||||||
call *__imp_ImpersonateSelf(%rip)
|
call *__imp_ImpersonateSelf(%rip)
|
||||||
leave
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
.endfn ImpersonateSelf,globl
|
.endfn ImpersonateSelf,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_InitiateShutdownW,InitiateShutdownW,1403
|
.imp advapi32,__imp_InitiateShutdownW,InitiateShutdownW,1403
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
InitiateShutdown:
|
InitiateShutdown:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_InitiateShutdownW(%rip),%rax
|
mov __imp_InitiateShutdownW(%rip),%rax
|
||||||
jmp __sysv2nt6
|
jmp __sysv2nt6
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn InitiateShutdown,globl
|
.endfn InitiateShutdown,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_LookupPrivilegeValueW,LookupPrivilegeValueW,1432
|
.imp advapi32,__imp_LookupPrivilegeValueW,LookupPrivilegeValueW,1432
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
LookupPrivilegeValue:
|
LookupPrivilegeValue:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_LookupPrivilegeValueW(%rip),%rax
|
mov __imp_LookupPrivilegeValueW(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn LookupPrivilegeValue,globl
|
.endfn LookupPrivilegeValue,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_MapGenericMask,MapGenericMask,0
|
.imp advapi32,__imp_MapGenericMask,MapGenericMask,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
MapGenericMask:
|
MapGenericMask:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_MapGenericMask(%rip),%rax
|
mov __imp_MapGenericMask(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn MapGenericMask,globl
|
.endfn MapGenericMask,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_OpenProcessToken,OpenProcessToken,0
|
.imp advapi32,__imp_OpenProcessToken,OpenProcessToken,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
OpenProcessToken:
|
OpenProcessToken:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_OpenProcessToken(%rip),%rax
|
mov __imp_OpenProcessToken(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn OpenProcessToken,globl
|
.endfn OpenProcessToken,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_OpenThreadToken,OpenThreadToken,0
|
.imp advapi32,__imp_OpenThreadToken,OpenThreadToken,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
OpenThreadToken:
|
OpenThreadToken:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_OpenThreadToken(%rip),%rax
|
mov __imp_OpenThreadToken(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn OpenThreadToken,globl
|
.endfn OpenThreadToken,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegCloseKey,RegCloseKey,0
|
.imp advapi32,__imp_RegCloseKey,RegCloseKey,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegCloseKey:
|
RegCloseKey:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
|
@ -11,7 +11,9 @@ RegCloseKey:
|
||||||
sub $32,%rsp
|
sub $32,%rsp
|
||||||
call *__imp_RegCloseKey(%rip)
|
call *__imp_RegCloseKey(%rip)
|
||||||
leave
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
.endfn RegCloseKey,globl
|
.endfn RegCloseKey,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegConnectRegistryW,RegConnectRegistryW,1608
|
.imp advapi32,__imp_RegConnectRegistryW,RegConnectRegistryW,1608
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegConnectRegistry:
|
RegConnectRegistry:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_RegConnectRegistryW(%rip),%rax
|
mov __imp_RegConnectRegistryW(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn RegConnectRegistry,globl
|
.endfn RegConnectRegistry,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegCreateKeyExW,RegCreateKeyExW,0
|
.imp advapi32,__imp_RegCreateKeyExW,RegCreateKeyExW,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegCreateKeyEx:
|
RegCreateKeyEx:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_RegCreateKeyExW(%rip),%rax
|
mov __imp_RegCreateKeyExW(%rip),%rax
|
||||||
jmp __sysv2nt10
|
jmp __sysv2nt10
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn RegCreateKeyEx,globl
|
.endfn RegCreateKeyEx,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegCreateKeyW,RegCreateKeyW,1616
|
.imp advapi32,__imp_RegCreateKeyW,RegCreateKeyW,1616
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegCreateKey:
|
RegCreateKey:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_RegCreateKeyW(%rip),%rax
|
mov __imp_RegCreateKeyW(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn RegCreateKey,globl
|
.endfn RegCreateKey,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegDeleteKeyExW,RegDeleteKeyExW,0
|
.imp advapi32,__imp_RegDeleteKeyExW,RegDeleteKeyExW,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegDeleteKeyEx:
|
RegDeleteKeyEx:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_RegDeleteKeyExW(%rip),%rax
|
mov __imp_RegDeleteKeyExW(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn RegDeleteKeyEx,globl
|
.endfn RegDeleteKeyEx,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegDeleteKeyW,RegDeleteKeyW,1624
|
.imp advapi32,__imp_RegDeleteKeyW,RegDeleteKeyW,1624
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegDeleteKey:
|
RegDeleteKey:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_RegDeleteKeyW(%rip),%rax
|
mov __imp_RegDeleteKeyW(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn RegDeleteKey,globl
|
.endfn RegDeleteKey,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegDeleteTreeW,RegDeleteTreeW,0
|
.imp advapi32,__imp_RegDeleteTreeW,RegDeleteTreeW,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegDeleteTree:
|
RegDeleteTree:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_RegDeleteTreeW(%rip),%rax
|
mov __imp_RegDeleteTreeW(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn RegDeleteTree,globl
|
.endfn RegDeleteTree,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegDeleteValueW,RegDeleteValueW,0
|
.imp advapi32,__imp_RegDeleteValueW,RegDeleteValueW,0
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegDeleteValue:
|
RegDeleteValue:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
mov __imp_RegDeleteValueW(%rip),%rax
|
mov __imp_RegDeleteValueW(%rip),%rax
|
||||||
jmp __sysv2nt
|
jmp __sysv2nt
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
ret
|
||||||
|
#endif
|
||||||
.endfn RegDeleteValue,globl
|
.endfn RegDeleteValue,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegDisablePredefinedCache,RegDisablePredefinedCache,1629
|
.imp advapi32,__imp_RegDisablePredefinedCache,RegDisablePredefinedCache,1629
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegDisablePredefinedCache:
|
RegDisablePredefinedCache:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
|
@ -11,7 +11,9 @@ RegDisablePredefinedCache:
|
||||||
sub $32,%rsp
|
sub $32,%rsp
|
||||||
call *__imp_RegDisablePredefinedCache(%rip)
|
call *__imp_RegDisablePredefinedCache(%rip)
|
||||||
leave
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
.endfn RegDisablePredefinedCache,globl
|
.endfn RegDisablePredefinedCache,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegDisableReflectionKey,RegDisableReflectionKey,1631
|
.imp advapi32,__imp_RegDisableReflectionKey,RegDisableReflectionKey,1631
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegDisableReflectionKey:
|
RegDisableReflectionKey:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
|
@ -11,7 +11,9 @@ RegDisableReflectionKey:
|
||||||
sub $32,%rsp
|
sub $32,%rsp
|
||||||
call *__imp_RegDisableReflectionKey(%rip)
|
call *__imp_RegDisableReflectionKey(%rip)
|
||||||
leave
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
.endfn RegDisableReflectionKey,globl
|
.endfn RegDisableReflectionKey,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "libc/nt/codegen.h"
|
#include "libc/nt/codegen.h"
|
||||||
.imp advapi32,__imp_RegEnableReflectionKey,RegEnableReflectionKey,1632
|
.imp advapi32,__imp_RegEnableReflectionKey,RegEnableReflectionKey,1632
|
||||||
|
|
||||||
#ifdef __x86_64__
|
|
||||||
.text.windows
|
.text.windows
|
||||||
RegEnableReflectionKey:
|
RegEnableReflectionKey:
|
||||||
|
#ifdef __x86_64__
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
.profilable
|
.profilable
|
||||||
|
@ -11,7 +11,9 @@ RegEnableReflectionKey:
|
||||||
sub $32,%rsp
|
sub $32,%rsp
|
||||||
call *__imp_RegEnableReflectionKey(%rip)
|
call *__imp_RegEnableReflectionKey(%rip)
|
||||||
leave
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
.endfn RegEnableReflectionKey,globl
|
.endfn RegEnableReflectionKey,globl
|
||||||
.previous
|
.previous
|
||||||
#endif
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue