diff --git a/libc/nt/kernel32/CancelIoEx.S b/libc/nt/kernel32/CancelIoEx.S index a7f1bc545..2154ae9bc 100644 --- a/libc/nt/kernel32/CancelIoEx.S +++ b/libc/nt/kernel32/CancelIoEx.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CancelIoEx,CancelIoEx - - .text.windows - .ftrace1 -__CancelIoEx: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CancelIoEx(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CancelIoEx,globl - .previous diff --git a/libc/nt/kernel32/CloseHandle.S b/libc/nt/kernel32/CloseHandle.S index 0617d5e50..de7c8b382 100644 --- a/libc/nt/kernel32/CloseHandle.S +++ b/libc/nt/kernel32/CloseHandle.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CloseHandle,CloseHandle - - .text.windows - .ftrace1 -__CloseHandle: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_CloseHandle(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __CloseHandle,globl - .previous diff --git a/libc/nt/kernel32/CreateDirectoryW.S b/libc/nt/kernel32/CreateDirectoryW.S index c450bfffa..c313be097 100644 --- a/libc/nt/kernel32/CreateDirectoryW.S +++ b/libc/nt/kernel32/CreateDirectoryW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreateDirectoryW,CreateDirectoryW - - .text.windows - .ftrace1 -__CreateDirectory: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreateDirectoryW(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreateDirectory,globl - .previous diff --git a/libc/nt/kernel32/CreateFileMappingNumaW.S b/libc/nt/kernel32/CreateFileMappingNumaW.S index e4a675c00..5901944cb 100644 --- a/libc/nt/kernel32/CreateFileMappingNumaW.S +++ b/libc/nt/kernel32/CreateFileMappingNumaW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreateFileMappingNumaW,CreateFileMappingNumaW - - .text.windows - .ftrace1 -__CreateFileMappingNuma: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreateFileMappingNumaW(%rip),%rax - jmp __sysv2nt8 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreateFileMappingNuma,globl - .previous diff --git a/libc/nt/kernel32/CreateFileMappingW.S b/libc/nt/kernel32/CreateFileMappingW.S index 1c5695f61..5bb3a9208 100644 --- a/libc/nt/kernel32/CreateFileMappingW.S +++ b/libc/nt/kernel32/CreateFileMappingW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreateFileMappingW,CreateFileMappingW - - .text.windows - .ftrace1 -__CreateFileMapping: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreateFileMappingW(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreateFileMapping,globl - .previous diff --git a/libc/nt/kernel32/CreateFileW.S b/libc/nt/kernel32/CreateFileW.S index e5c94ccc0..985f774ba 100644 --- a/libc/nt/kernel32/CreateFileW.S +++ b/libc/nt/kernel32/CreateFileW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreateFileW,CreateFileW - - .text.windows - .ftrace1 -__CreateFile: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreateFileW(%rip),%rax - jmp __sysv2nt8 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreateFile,globl - .previous diff --git a/libc/nt/kernel32/CreateNamedPipeW.S b/libc/nt/kernel32/CreateNamedPipeW.S index 2cb5c4738..0eafe61d4 100644 --- a/libc/nt/kernel32/CreateNamedPipeW.S +++ b/libc/nt/kernel32/CreateNamedPipeW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreateNamedPipeW,CreateNamedPipeW - - .text.windows - .ftrace1 -__CreateNamedPipe: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreateNamedPipeW(%rip),%rax - jmp __sysv2nt8 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreateNamedPipe,globl - .previous diff --git a/libc/nt/kernel32/CreatePipe.S b/libc/nt/kernel32/CreatePipe.S index 7dcf563f4..b32a169ad 100644 --- a/libc/nt/kernel32/CreatePipe.S +++ b/libc/nt/kernel32/CreatePipe.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreatePipe,CreatePipe - - .text.windows - .ftrace1 -__CreatePipe: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreatePipe(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreatePipe,globl - .previous diff --git a/libc/nt/kernel32/CreateProcessW.S b/libc/nt/kernel32/CreateProcessW.S index eeb9a3a2c..72fcbae50 100644 --- a/libc/nt/kernel32/CreateProcessW.S +++ b/libc/nt/kernel32/CreateProcessW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreateProcessW,CreateProcessW - - .text.windows - .ftrace1 -__CreateProcess: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreateProcessW(%rip),%rax - jmp __sysv2nt10 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreateProcess,globl - .previous diff --git a/libc/nt/kernel32/CreateSymbolicLinkW.S b/libc/nt/kernel32/CreateSymbolicLinkW.S index 4878ca601..69a3fa41d 100644 --- a/libc/nt/kernel32/CreateSymbolicLinkW.S +++ b/libc/nt/kernel32/CreateSymbolicLinkW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreateSymbolicLinkW,CreateSymbolicLinkW - - .text.windows - .ftrace1 -__CreateSymbolicLink: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreateSymbolicLinkW(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreateSymbolicLink,globl - .previous diff --git a/libc/nt/kernel32/CreateThread.S b/libc/nt/kernel32/CreateThread.S index ff483b855..74ba58ced 100644 --- a/libc/nt/kernel32/CreateThread.S +++ b/libc/nt/kernel32/CreateThread.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_CreateThread,CreateThread - - .text.windows - .ftrace1 -__CreateThread: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_CreateThread(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __CreateThread,globl - .previous diff --git a/libc/nt/kernel32/DeleteFileW.S b/libc/nt/kernel32/DeleteFileW.S index 68de84d8d..7833080f1 100644 --- a/libc/nt/kernel32/DeleteFileW.S +++ b/libc/nt/kernel32/DeleteFileW.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_DeleteFileW,DeleteFileW - - .text.windows - .ftrace1 -__DeleteFile: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_DeleteFileW(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __DeleteFile,globl - .previous diff --git a/libc/nt/kernel32/DeviceIoControl.S b/libc/nt/kernel32/DeviceIoControl.S index a3cf4da30..5cc76228b 100644 --- a/libc/nt/kernel32/DeviceIoControl.S +++ b/libc/nt/kernel32/DeviceIoControl.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_DeviceIoControl,DeviceIoControl - - .text.windows - .ftrace1 -__DeviceIoControl: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_DeviceIoControl(%rip),%rax - jmp __sysv2nt8 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __DeviceIoControl,globl - .previous diff --git a/libc/nt/kernel32/FindClose.S b/libc/nt/kernel32/FindClose.S index 1a9fe2b65..eb6531f1d 100644 --- a/libc/nt/kernel32/FindClose.S +++ b/libc/nt/kernel32/FindClose.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_FindClose,FindClose - - .text.windows - .ftrace1 -__FindClose: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_FindClose(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __FindClose,globl - .previous diff --git a/libc/nt/kernel32/FindFirstFileW.S b/libc/nt/kernel32/FindFirstFileW.S index 496c420ed..e76b83ed6 100644 --- a/libc/nt/kernel32/FindFirstFileW.S +++ b/libc/nt/kernel32/FindFirstFileW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_FindFirstFileW,FindFirstFileW - - .text.windows - .ftrace1 -__FindFirstFile: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_FindFirstFileW(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __FindFirstFile,globl - .previous diff --git a/libc/nt/kernel32/FindNextFileW.S b/libc/nt/kernel32/FindNextFileW.S index a9755c734..bca31fb22 100644 --- a/libc/nt/kernel32/FindNextFileW.S +++ b/libc/nt/kernel32/FindNextFileW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_FindNextFileW,FindNextFileW - - .text.windows - .ftrace1 -__FindNextFile: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_FindNextFileW(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __FindNextFile,globl - .previous diff --git a/libc/nt/kernel32/FlushFileBuffers.S b/libc/nt/kernel32/FlushFileBuffers.S index 1019056b8..9858d6a70 100644 --- a/libc/nt/kernel32/FlushFileBuffers.S +++ b/libc/nt/kernel32/FlushFileBuffers.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_FlushFileBuffers,FlushFileBuffers - - .text.windows - .ftrace1 -__FlushFileBuffers: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_FlushFileBuffers(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __FlushFileBuffers,globl - .previous diff --git a/libc/nt/kernel32/FlushViewOfFile.S b/libc/nt/kernel32/FlushViewOfFile.S index 7f4dc31cd..0e11a0185 100644 --- a/libc/nt/kernel32/FlushViewOfFile.S +++ b/libc/nt/kernel32/FlushViewOfFile.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_FlushViewOfFile,FlushViewOfFile - - .text.windows - .ftrace1 -__FlushViewOfFile: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_FlushViewOfFile(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __FlushViewOfFile,globl - .previous diff --git a/libc/nt/kernel32/GenerateConsoleCtrlEvent.S b/libc/nt/kernel32/GenerateConsoleCtrlEvent.S index 141d93398..e599b2001 100644 --- a/libc/nt/kernel32/GenerateConsoleCtrlEvent.S +++ b/libc/nt/kernel32/GenerateConsoleCtrlEvent.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_GenerateConsoleCtrlEvent,GenerateConsoleCtrlEvent - - .text.windows - .ftrace1 -__GenerateConsoleCtrlEvent: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_GenerateConsoleCtrlEvent(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __GenerateConsoleCtrlEvent,globl - .previous diff --git a/libc/nt/kernel32/GetExitCodeProcess.S b/libc/nt/kernel32/GetExitCodeProcess.S index e83800416..873335014 100644 --- a/libc/nt/kernel32/GetExitCodeProcess.S +++ b/libc/nt/kernel32/GetExitCodeProcess.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_GetExitCodeProcess,GetExitCodeProcess - - .text.windows - .ftrace1 -__GetExitCodeProcess: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_GetExitCodeProcess(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __GetExitCodeProcess,globl - .previous diff --git a/libc/nt/kernel32/GetFileAttributesW.S b/libc/nt/kernel32/GetFileAttributesW.S index c0e9c952b..935c0d0e5 100644 --- a/libc/nt/kernel32/GetFileAttributesW.S +++ b/libc/nt/kernel32/GetFileAttributesW.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_GetFileAttributesW,GetFileAttributesW - - .text.windows - .ftrace1 -__GetFileAttributes: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_GetFileAttributesW(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __GetFileAttributes,globl - .previous diff --git a/libc/nt/kernel32/LockFileEx.S b/libc/nt/kernel32/LockFileEx.S index 89a28505d..b1c0a2eb0 100644 --- a/libc/nt/kernel32/LockFileEx.S +++ b/libc/nt/kernel32/LockFileEx.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_LockFileEx,LockFileEx - - .text.windows - .ftrace1 -__LockFileEx: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_LockFileEx(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __LockFileEx,globl - .previous diff --git a/libc/nt/kernel32/MapViewOfFileEx.S b/libc/nt/kernel32/MapViewOfFileEx.S index 34507d3e6..c9dc3e1d3 100644 --- a/libc/nt/kernel32/MapViewOfFileEx.S +++ b/libc/nt/kernel32/MapViewOfFileEx.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_MapViewOfFileEx,MapViewOfFileEx - - .text.windows - .ftrace1 -__MapViewOfFileEx: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_MapViewOfFileEx(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __MapViewOfFileEx,globl - .previous diff --git a/libc/nt/kernel32/MapViewOfFileExNuma.S b/libc/nt/kernel32/MapViewOfFileExNuma.S index 652678b67..94fa3aca8 100644 --- a/libc/nt/kernel32/MapViewOfFileExNuma.S +++ b/libc/nt/kernel32/MapViewOfFileExNuma.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_MapViewOfFileExNuma,MapViewOfFileExNuma - - .text.windows - .ftrace1 -__MapViewOfFileExNuma: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_MapViewOfFileExNuma(%rip),%rax - jmp __sysv2nt8 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __MapViewOfFileExNuma,globl - .previous diff --git a/libc/nt/kernel32/MoveFileExW.S b/libc/nt/kernel32/MoveFileExW.S index 03be556bb..6549a2b29 100644 --- a/libc/nt/kernel32/MoveFileExW.S +++ b/libc/nt/kernel32/MoveFileExW.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_MoveFileExW,MoveFileExW - - .text.windows - .ftrace1 -__MoveFileEx: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_MoveFileExW(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __MoveFileEx,globl - .previous diff --git a/libc/nt/kernel32/OpenProcess.S b/libc/nt/kernel32/OpenProcess.S index bb0e8b304..2703c58cf 100644 --- a/libc/nt/kernel32/OpenProcess.S +++ b/libc/nt/kernel32/OpenProcess.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_OpenProcess,OpenProcess - - .text.windows - .ftrace1 -__OpenProcess: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_OpenProcess(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __OpenProcess,globl - .previous diff --git a/libc/nt/kernel32/ReOpenFile.S b/libc/nt/kernel32/ReOpenFile.S index 2ec841f9a..6f2db5d02 100644 --- a/libc/nt/kernel32/ReOpenFile.S +++ b/libc/nt/kernel32/ReOpenFile.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_ReOpenFile,ReOpenFile - - .text.windows - .ftrace1 -__ReOpenFile: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_ReOpenFile(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __ReOpenFile,globl - .previous diff --git a/libc/nt/kernel32/RemoveDirectoryW.S b/libc/nt/kernel32/RemoveDirectoryW.S index 29f29f49a..fdc8b1d8f 100644 --- a/libc/nt/kernel32/RemoveDirectoryW.S +++ b/libc/nt/kernel32/RemoveDirectoryW.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_RemoveDirectoryW,RemoveDirectoryW - - .text.windows - .ftrace1 -__RemoveDirectory: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_RemoveDirectoryW(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __RemoveDirectory,globl - .previous diff --git a/libc/nt/kernel32/SetCurrentDirectoryW.S b/libc/nt/kernel32/SetCurrentDirectoryW.S index 60abfb462..1a5227ff0 100644 --- a/libc/nt/kernel32/SetCurrentDirectoryW.S +++ b/libc/nt/kernel32/SetCurrentDirectoryW.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_SetCurrentDirectoryW,SetCurrentDirectoryW - - .text.windows - .ftrace1 -__SetCurrentDirectory: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_SetCurrentDirectoryW(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __SetCurrentDirectory,globl - .previous diff --git a/libc/nt/kernel32/TerminateProcess.S b/libc/nt/kernel32/TerminateProcess.S index ccc8d3960..fe2ef0817 100644 --- a/libc/nt/kernel32/TerminateProcess.S +++ b/libc/nt/kernel32/TerminateProcess.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_TerminateProcess,TerminateProcess - - .text.windows - .ftrace1 -__TerminateProcess: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_TerminateProcess(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __TerminateProcess,globl - .previous diff --git a/libc/nt/kernel32/UnlockFileEx.S b/libc/nt/kernel32/UnlockFileEx.S index bb82191ea..a298acf40 100644 --- a/libc/nt/kernel32/UnlockFileEx.S +++ b/libc/nt/kernel32/UnlockFileEx.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_UnlockFileEx,UnlockFileEx - - .text.windows - .ftrace1 -__UnlockFileEx: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_UnlockFileEx(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __UnlockFileEx,globl - .previous diff --git a/libc/nt/kernel32/UnmapViewOfFile.S b/libc/nt/kernel32/UnmapViewOfFile.S index 58156dab3..45be45146 100644 --- a/libc/nt/kernel32/UnmapViewOfFile.S +++ b/libc/nt/kernel32/UnmapViewOfFile.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_UnmapViewOfFile,UnmapViewOfFile - - .text.windows - .ftrace1 -__UnmapViewOfFile: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_UnmapViewOfFile(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __UnmapViewOfFile,globl - .previous diff --git a/libc/nt/kernel32/VirtualProtect.S b/libc/nt/kernel32/VirtualProtect.S index 3d2b0cc7c..fedafbed6 100644 --- a/libc/nt/kernel32/VirtualProtect.S +++ b/libc/nt/kernel32/VirtualProtect.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_VirtualProtect,VirtualProtect - - .text.windows - .ftrace1 -__VirtualProtect: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_VirtualProtect(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __VirtualProtect,globl - .previous diff --git a/libc/nt/kernel32/WaitForMultipleObjects.S b/libc/nt/kernel32/WaitForMultipleObjects.S index eedcfbbc3..a8fad4da9 100644 --- a/libc/nt/kernel32/WaitForMultipleObjects.S +++ b/libc/nt/kernel32/WaitForMultipleObjects.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_WaitForMultipleObjects,WaitForMultipleObjects - - .text.windows - .ftrace1 -__WaitForMultipleObjects: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_WaitForMultipleObjects(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __WaitForMultipleObjects,globl - .previous diff --git a/libc/nt/kernel32/WaitForSingleObject.S b/libc/nt/kernel32/WaitForSingleObject.S index 6ce37ca12..b20aadd29 100644 --- a/libc/nt/kernel32/WaitForSingleObject.S +++ b/libc/nt/kernel32/WaitForSingleObject.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp kernel32,__imp_WaitForSingleObject,WaitForSingleObject - - .text.windows - .ftrace1 -__WaitForSingleObject: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_WaitForSingleObject(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __WaitForSingleObject,globl - .previous diff --git a/libc/nt/master.sh b/libc/nt/master.sh index 7face4b32..af27f24d7 100755 --- a/libc/nt/master.sh +++ b/libc/nt/master.sh @@ -9,6 +9,41 @@ # KERNEL32.DLL # # Name Actual DLL Arity +imp '' CancelIoEx kernel32 2 +imp '' CloseHandle kernel32 1 +imp '' CreateDirectoryW kernel32 2 +imp '' CreateFileMappingNumaW kernel32 7 +imp '' CreateFileMappingW kernel32 6 +imp '' CreateFileW kernel32 7 +imp '' CreateNamedPipeW kernel32 8 +imp '' CreatePipe kernel32 4 +imp '' CreateProcessW kernel32 10 +imp '' CreateSymbolicLinkW kernel32 3 +imp '' CreateThread kernel32 6 +imp '' DeleteFileW kernel32 1 +imp '' DeviceIoControl kernel32 8 +imp '' FindClose kernel32 1 +imp '' FindFirstFileW kernel32 2 +imp '' FindNextFileW kernel32 2 +imp '' FlushFileBuffers kernel32 1 +imp '' FlushViewOfFile kernel32 2 +imp '' GenerateConsoleCtrlEvent kernel32 2 +imp '' GetExitCodeProcess kernel32 2 +imp '' GetFileAttributesW kernel32 1 +imp '' LockFileEx kernel32 6 +imp '' MapViewOfFileEx kernel32 6 +imp '' MapViewOfFileExNuma kernel32 7 +imp '' MoveFileExW kernel32 3 +imp '' OpenProcess kernel32 3 +imp '' ReOpenFile kernel32 4 # TODO(jart): 6.2 and higher +imp '' RemoveDirectoryW kernel32 1 +imp '' SetCurrentDirectoryW kernel32 1 +imp '' TerminateProcess kernel32 2 +imp '' UnlockFileEx kernel32 5 +imp '' UnmapViewOfFile kernel32 1 +imp '' VirtualProtect kernel32 4 +imp '' WaitForMultipleObjects kernel32 4 +imp '' WaitForSingleObject kernel32 2 imp 'AcquireSRWLockExclusive' AcquireSRWLockExclusive kernel32 1 imp 'AcquireSRWLockShared' AcquireSRWLockShared kernel32 1 imp 'AddVectoredContinueHandler' AddVectoredContinueHandler kernel32 2 @@ -259,41 +294,6 @@ imp 'WriteConsoleOutputCharacter' WriteConsoleOutputCharacterW kernel32 5 imp 'WriteFile' WriteFile kernel32 5 imp 'WriteFileEx' WriteFileEx kernel32 5 imp 'WriteFileGather' WriteFileGather kernel32 5 -imp '__CancelIoEx' CancelIoEx kernel32 2 -imp '__CloseHandle' CloseHandle kernel32 1 -imp '__CreateDirectory' CreateDirectoryW kernel32 2 -imp '__CreateFile' CreateFileW kernel32 7 -imp '__CreateFileMapping' CreateFileMappingW kernel32 6 -imp '__CreateFileMappingNuma' CreateFileMappingNumaW kernel32 7 -imp '__CreateNamedPipe' CreateNamedPipeW kernel32 8 -imp '__CreatePipe' CreatePipe kernel32 4 -imp '__CreateProcess' CreateProcessW kernel32 10 -imp '__CreateSymbolicLink' CreateSymbolicLinkW kernel32 3 -imp '__CreateThread' CreateThread kernel32 6 -imp '__DeleteFile' DeleteFileW kernel32 1 -imp '__DeviceIoControl' DeviceIoControl kernel32 8 -imp '__FindClose' FindClose kernel32 1 -imp '__FindFirstFile' FindFirstFileW kernel32 2 -imp '__FindNextFile' FindNextFileW kernel32 2 -imp '__FlushFileBuffers' FlushFileBuffers kernel32 1 -imp '__FlushViewOfFile' FlushViewOfFile kernel32 2 -imp '__GenerateConsoleCtrlEvent' GenerateConsoleCtrlEvent kernel32 2 -imp '__GetExitCodeProcess' GetExitCodeProcess kernel32 2 -imp '__GetFileAttributes' GetFileAttributesW kernel32 1 -imp '__LockFileEx' LockFileEx kernel32 6 -imp '__MapViewOfFileEx' MapViewOfFileEx kernel32 6 -imp '__MapViewOfFileExNuma' MapViewOfFileExNuma kernel32 7 -imp '__MoveFileEx' MoveFileExW kernel32 3 -imp '__OpenProcess' OpenProcess kernel32 3 -imp '__ReOpenFile' ReOpenFile kernel32 4 # TODO(jart): 6.2 and higher -imp '__RemoveDirectory' RemoveDirectoryW kernel32 1 -imp '__SetCurrentDirectory' SetCurrentDirectoryW kernel32 1 -imp '__TerminateProcess' TerminateProcess kernel32 2 -imp '__UnlockFileEx' UnlockFileEx kernel32 5 -imp '__UnmapViewOfFile' UnmapViewOfFile kernel32 1 -imp '__VirtualProtect' VirtualProtect kernel32 4 -imp '__WaitForMultipleObjects' WaitForMultipleObjects kernel32 4 -imp '__WaitForSingleObject' WaitForSingleObject kernel32 2 # ADVAPI32.DLL # @@ -490,6 +490,27 @@ imp 'WSARecvEx' WSARecvEx MsWSock 4 # WS2_32.DLL # # Name Actual DLL Arity +imp '' WSAGetOverlappedResult ws2_32 5 +imp '' WSARecv ws2_32 7 +imp '' WSARecvFrom ws2_32 9 +imp '' WSAWaitForMultipleEvents ws2_32 5 +imp '' accept ws2_32 3 # we're using WSAAccept() +imp '' bind ws2_32 3 +imp '' closesocket ws2_32 1 +imp '' getpeername ws2_32 3 +imp '' getsockname ws2_32 3 +imp '' getsockopt ws2_32 5 +imp '' ioctlsocket ws2_32 3 +imp '' listen ws2_32 2 +imp '' recv ws2_32 4 # we're using WSARecvFrom() +imp '' recvfrom ws2_32 6 # we're using WSARecvFrom() +imp '' select ws2_32 5 +imp '' send ws2_32 4 # we're using WSASendTo() +imp '' sendto ws2_32 6 # we're using WSASendTo() +imp '' setsockopt ws2_32 5 +imp '' shutdown ws2_32 2 +imp '' socket ws2_32 3 +imp '' socket ws2_32 3 imp 'FreeAddrInfo' FreeAddrInfoW ws2_32 1 imp 'FreeAddrInfoEx' FreeAddrInfoExW ws2_32 1 imp 'GetAddrInfo' GetAddrInfoW ws2_32 4 @@ -542,27 +563,6 @@ imp 'WSASetLastError' WSASetLastError ws2_32 1 imp 'WSASetService' WSASetServiceW ws2_32 3 imp 'WSASocket' WSASocketW ws2_32 6 imp 'WSAStartup' WSAStartup ws2_32 2 -imp '__sys_socket_nt' socket ws2_32 3 -imp '__sys_accept_nt' accept ws2_32 3 # we're using WSAAccept() -imp '__sys_bind_nt' bind ws2_32 3 -imp '__sys_closesocket_nt' closesocket ws2_32 1 -imp '__sys_getpeername_nt' getpeername ws2_32 3 -imp '__sys_getsockname_nt' getsockname ws2_32 3 -imp '__sys_getsockopt_nt' getsockopt ws2_32 5 -imp '__sys_ioctlsocket_nt' ioctlsocket ws2_32 3 -imp '__sys_listen_nt' listen ws2_32 2 -imp '__sys_recvfrom_nt' recvfrom ws2_32 6 # we're using WSARecvFrom() -imp '__sys_select_nt' select ws2_32 5 -imp '__sys_sendto_nt' sendto ws2_32 6 # we're using WSASendTo() -imp '__sys_setsockopt_nt' setsockopt ws2_32 5 -imp '__sys_shutdown_nt' shutdown ws2_32 2 -imp '__sys_socket_nt' socket ws2_32 3 -imp '__WSARecv' WSARecv ws2_32 7 -imp '__WSARecvFrom' WSARecvFrom ws2_32 9 -imp '__WSAWaitForMultipleEvents' WSAWaitForMultipleEvents ws2_32 5 -imp '__sys_recv_nt' recv ws2_32 4 # we're using WSARecvFrom() -imp '__sys_send_nt' send ws2_32 4 # we're using WSASendTo() -imp '__WSAGetOverlappedResult' WSAGetOverlappedResult ws2_32 5 # IPHLPAPI.DLL # diff --git a/libc/nt/ws2_32/WSAGetOverlappedResult.S b/libc/nt/ws2_32/WSAGetOverlappedResult.S index 6c6064a77..5dbbf8d0d 100644 --- a/libc/nt/ws2_32/WSAGetOverlappedResult.S +++ b/libc/nt/ws2_32/WSAGetOverlappedResult.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_WSAGetOverlappedResult,WSAGetOverlappedResult - - .text.windows - .ftrace1 -__WSAGetOverlappedResult: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_WSAGetOverlappedResult(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __WSAGetOverlappedResult,globl - .previous diff --git a/libc/nt/ws2_32/WSARecv.S b/libc/nt/ws2_32/WSARecv.S index 9b3c5af45..08be09eb8 100644 --- a/libc/nt/ws2_32/WSARecv.S +++ b/libc/nt/ws2_32/WSARecv.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_WSARecv,WSARecv - - .text.windows - .ftrace1 -__WSARecv: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_WSARecv(%rip),%rax - jmp __sysv2nt8 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __WSARecv,globl - .previous diff --git a/libc/nt/ws2_32/WSARecvFrom.S b/libc/nt/ws2_32/WSARecvFrom.S index 3e075544e..f2020594f 100644 --- a/libc/nt/ws2_32/WSARecvFrom.S +++ b/libc/nt/ws2_32/WSARecvFrom.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_WSARecvFrom,WSARecvFrom - - .text.windows - .ftrace1 -__WSARecvFrom: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_WSARecvFrom(%rip),%rax - jmp __sysv2nt10 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __WSARecvFrom,globl - .previous diff --git a/libc/nt/ws2_32/WSAWaitForMultipleEvents.S b/libc/nt/ws2_32/WSAWaitForMultipleEvents.S index ae112f8b4..e15311a6d 100644 --- a/libc/nt/ws2_32/WSAWaitForMultipleEvents.S +++ b/libc/nt/ws2_32/WSAWaitForMultipleEvents.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_WSAWaitForMultipleEvents,WSAWaitForMultipleEvents - - .text.windows - .ftrace1 -__WSAWaitForMultipleEvents: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_WSAWaitForMultipleEvents(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __WSAWaitForMultipleEvents,globl - .previous diff --git a/libc/nt/ws2_32/accept.S b/libc/nt/ws2_32/accept.S index b4216166c..763e8c1ae 100644 --- a/libc/nt/ws2_32/accept.S +++ b/libc/nt/ws2_32/accept.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_accept,accept - - .text.windows - .ftrace1 -__sys_accept_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_accept(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_accept_nt,globl - .previous diff --git a/libc/nt/ws2_32/bind.S b/libc/nt/ws2_32/bind.S index 88562ccf7..227b480cc 100644 --- a/libc/nt/ws2_32/bind.S +++ b/libc/nt/ws2_32/bind.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_bind,bind - - .text.windows - .ftrace1 -__sys_bind_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_bind(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_bind_nt,globl - .previous diff --git a/libc/nt/ws2_32/closesocket.S b/libc/nt/ws2_32/closesocket.S index 925e3c945..39e4e40cd 100644 --- a/libc/nt/ws2_32/closesocket.S +++ b/libc/nt/ws2_32/closesocket.S @@ -1,20 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_closesocket,closesocket - - .text.windows - .ftrace1 -__sys_closesocket_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov %rdi,%rcx - sub $32,%rsp - call *__imp_closesocket(%rip) - leave -#elif defined(__aarch64__) - mov x0,#0 -#endif - ret - .endfn __sys_closesocket_nt,globl - .previous diff --git a/libc/nt/ws2_32/getpeername.S b/libc/nt/ws2_32/getpeername.S index 499803572..d9b6148fb 100644 --- a/libc/nt/ws2_32/getpeername.S +++ b/libc/nt/ws2_32/getpeername.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_getpeername,getpeername - - .text.windows - .ftrace1 -__sys_getpeername_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_getpeername(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_getpeername_nt,globl - .previous diff --git a/libc/nt/ws2_32/getsockname.S b/libc/nt/ws2_32/getsockname.S index 8aad7e4c6..9bc750f61 100644 --- a/libc/nt/ws2_32/getsockname.S +++ b/libc/nt/ws2_32/getsockname.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_getsockname,getsockname - - .text.windows - .ftrace1 -__sys_getsockname_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_getsockname(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_getsockname_nt,globl - .previous diff --git a/libc/nt/ws2_32/getsockopt.S b/libc/nt/ws2_32/getsockopt.S index a42b7fd57..6f443ef04 100644 --- a/libc/nt/ws2_32/getsockopt.S +++ b/libc/nt/ws2_32/getsockopt.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_getsockopt,getsockopt - - .text.windows - .ftrace1 -__sys_getsockopt_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_getsockopt(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_getsockopt_nt,globl - .previous diff --git a/libc/nt/ws2_32/ioctlsocket.S b/libc/nt/ws2_32/ioctlsocket.S index 91d6a0dc4..31e1a9784 100644 --- a/libc/nt/ws2_32/ioctlsocket.S +++ b/libc/nt/ws2_32/ioctlsocket.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_ioctlsocket,ioctlsocket - - .text.windows - .ftrace1 -__sys_ioctlsocket_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_ioctlsocket(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_ioctlsocket_nt,globl - .previous diff --git a/libc/nt/ws2_32/listen.S b/libc/nt/ws2_32/listen.S index e31543738..db2aec106 100644 --- a/libc/nt/ws2_32/listen.S +++ b/libc/nt/ws2_32/listen.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_listen,listen - - .text.windows - .ftrace1 -__sys_listen_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_listen(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_listen_nt,globl - .previous diff --git a/libc/nt/ws2_32/recv.S b/libc/nt/ws2_32/recv.S index 260d5814b..e3e6bd47f 100644 --- a/libc/nt/ws2_32/recv.S +++ b/libc/nt/ws2_32/recv.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_recv,recv - - .text.windows - .ftrace1 -__sys_recv_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_recv(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_recv_nt,globl - .previous diff --git a/libc/nt/ws2_32/recvfrom.S b/libc/nt/ws2_32/recvfrom.S index 583f9036e..81fc39cd3 100644 --- a/libc/nt/ws2_32/recvfrom.S +++ b/libc/nt/ws2_32/recvfrom.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_recvfrom,recvfrom - - .text.windows - .ftrace1 -__sys_recvfrom_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_recvfrom(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_recvfrom_nt,globl - .previous diff --git a/libc/nt/ws2_32/select.S b/libc/nt/ws2_32/select.S index 1096a94e8..30c9e7f1a 100644 --- a/libc/nt/ws2_32/select.S +++ b/libc/nt/ws2_32/select.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_select,select - - .text.windows - .ftrace1 -__sys_select_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_select(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_select_nt,globl - .previous diff --git a/libc/nt/ws2_32/send.S b/libc/nt/ws2_32/send.S index bec7e9f79..dbb1f3b36 100644 --- a/libc/nt/ws2_32/send.S +++ b/libc/nt/ws2_32/send.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_send,send - - .text.windows - .ftrace1 -__sys_send_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_send(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_send_nt,globl - .previous diff --git a/libc/nt/ws2_32/sendto.S b/libc/nt/ws2_32/sendto.S index fb626c747..57151936c 100644 --- a/libc/nt/ws2_32/sendto.S +++ b/libc/nt/ws2_32/sendto.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_sendto,sendto - - .text.windows - .ftrace1 -__sys_sendto_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_sendto(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_sendto_nt,globl - .previous diff --git a/libc/nt/ws2_32/setsockopt.S b/libc/nt/ws2_32/setsockopt.S index d34a4c34d..adc33e3aa 100644 --- a/libc/nt/ws2_32/setsockopt.S +++ b/libc/nt/ws2_32/setsockopt.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_setsockopt,setsockopt - - .text.windows - .ftrace1 -__sys_setsockopt_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_setsockopt(%rip),%rax - jmp __sysv2nt6 -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_setsockopt_nt,globl - .previous diff --git a/libc/nt/ws2_32/shutdown.S b/libc/nt/ws2_32/shutdown.S index af00d9c62..186c6d5a0 100644 --- a/libc/nt/ws2_32/shutdown.S +++ b/libc/nt/ws2_32/shutdown.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_shutdown,shutdown - - .text.windows - .ftrace1 -__sys_shutdown_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_shutdown(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_shutdown_nt,globl - .previous diff --git a/libc/nt/ws2_32/socket.S b/libc/nt/ws2_32/socket.S index c693378ac..8c3956d3c 100644 --- a/libc/nt/ws2_32/socket.S +++ b/libc/nt/ws2_32/socket.S @@ -1,18 +1,2 @@ #include "libc/nt/codegen.h" .imp ws2_32,__imp_socket,socket - - .text.windows - .ftrace1 -__sys_socket_nt: - .ftrace2 -#ifdef __x86_64__ - push %rbp - mov %rsp,%rbp - mov __imp_socket(%rip),%rax - jmp __sysv2nt -#elif defined(__aarch64__) - mov x0,#0 - ret -#endif - .endfn __sys_socket_nt,globl - .previous diff --git a/libc/sock/accept-nt.c b/libc/sock/accept-nt.c index 60d9c16fa..75d117ef9 100644 --- a/libc/sock/accept-nt.c +++ b/libc/sock/accept-nt.c @@ -21,6 +21,7 @@ #include "libc/errno.h" #include "libc/macros.internal.h" #include "libc/mem/mem.h" +#include "libc/nt/thunk/msabi.h" #include "libc/nt/winsock.h" #include "libc/sock/internal.h" #include "libc/sock/struct/sockaddr.h" @@ -30,6 +31,8 @@ #include "libc/sysv/consts/o.h" #include "libc/sysv/consts/sock.h" +__msabi extern typeof(__sys_closesocket_nt) *const __imp_closesocket; + union AcceptExAddr { struct sockaddr_storage addr; char buf[sizeof(struct sockaddr_storage) + 16]; @@ -70,7 +73,7 @@ textwindows int sys_accept_nt(struct Fd *fd, struct sockaddr_storage *addr, if (__wsablock(fd, &overlapped, &completion_flags, kSigOpRestartable, sockfd->rcvtimeo) == -1) { WSACloseEvent(overlapped.hEvent); - __sys_closesocket_nt(handle); + __imp_closesocket(handle); free(sockfd2); return -1; } diff --git a/libc/sock/bind-nt.c b/libc/sock/bind-nt.c index 720d58f99..f391a6ffc 100644 --- a/libc/sock/bind-nt.c +++ b/libc/sock/bind-nt.c @@ -28,7 +28,7 @@ __msabi extern typeof(__sys_bind_nt) *const __imp_bind; textwindows int sys_bind_nt(struct Fd *fd, const void *addr, uint32_t addrsize) { unassert(fd->kind == kFdSocket); - if (__sys_bind_nt(fd->handle, addr, addrsize) != -1) { + if (__imp_bind(fd->handle, addr, addrsize) != -1) { return 0; } else { return __winsockerr(); diff --git a/libc/sock/getsockname.c b/libc/sock/getsockname.c index 47535ce4e..53e020938 100644 --- a/libc/sock/getsockname.c +++ b/libc/sock/getsockname.c @@ -22,6 +22,7 @@ #include "libc/intrin/asan.internal.h" #include "libc/intrin/strace.internal.h" #include "libc/nt/errors.h" +#include "libc/nt/thunk/msabi.h" #include "libc/nt/winsock.h" #include "libc/sock/internal.h" #include "libc/sock/sock.h" @@ -30,10 +31,14 @@ #include "libc/sock/syscall_fd.internal.h" #include "libc/sysv/errfuns.h" +__msabi extern typeof(__sys_getsockname_nt) *const __imp_getsockname; +__msabi extern typeof(__sys_getpeername_nt) *const __imp_getpeername; + static int __getsockpeername(int fd, struct sockaddr *out_addr, uint32_t *inout_addrsize, const char *name, int impl_sysv(int, void *, uint32_t *), - int impl_win32(uint64_t, void *, uint32_t *)) { + int (*__msabi impl_win32)(uint64_t, void *, + uint32_t *)) { int rc; struct sockaddr_storage ss = {0}; uint32_t size = sizeof(ss); @@ -41,8 +46,7 @@ static int __getsockpeername(int fd, struct sockaddr *out_addr, if (IsWindows()) { if (__isfdkind(fd, kFdSocket)) { if ((rc = impl_win32(g_fds.p[fd].handle, &ss, &size))) { - if (impl_win32 == __sys_getsockname_nt && - WSAGetLastError() == WSAEINVAL) { + if (impl_win32 == __imp_getsockname && WSAGetLastError() == WSAEINVAL) { // The socket has not been bound to an address with bind, or // ADDR_ANY is specified in bind but connection has not yet // occurred. -MSDN @@ -78,7 +82,7 @@ static int __getsockpeername(int fd, struct sockaddr *out_addr, */ int getsockname(int fd, struct sockaddr *out_addr, uint32_t *inout_addrsize) { return __getsockpeername(fd, out_addr, inout_addrsize, "getsockname", - __sys_getsockname, __sys_getsockname_nt); + __sys_getsockname, __imp_getsockname); } /** @@ -88,5 +92,5 @@ int getsockname(int fd, struct sockaddr *out_addr, uint32_t *inout_addrsize) { */ int getpeername(int fd, struct sockaddr *out_addr, uint32_t *inout_addrsize) { return __getsockpeername(fd, out_addr, inout_addrsize, "getpeername", - __sys_getpeername, __sys_getpeername_nt); + __sys_getpeername, __imp_getpeername); } diff --git a/libc/sock/socket-nt.c b/libc/sock/socket-nt.c index add1f2bb7..6eaed651b 100644 --- a/libc/sock/socket-nt.c +++ b/libc/sock/socket-nt.c @@ -24,6 +24,7 @@ #include "libc/mem/mem.h" #include "libc/nt/enum/fileflagandattributes.h" #include "libc/nt/iphlpapi.h" +#include "libc/nt/thunk/msabi.h" #include "libc/nt/winsock.h" #include "libc/sock/internal.h" #include "libc/sock/yoink.inc" @@ -35,6 +36,8 @@ #include "libc/sysv/consts/sock.h" #include "libc/sysv/consts/sol.h" +__msabi extern typeof(__sys_setsockopt_nt) *const __imp_setsockopt; + /* * ioctl(SIOCGIFCONFIG) for Windows need to access the following * functions through weak reference. This ensure those symbols are not @@ -59,7 +62,7 @@ textwindows int sys_socket_nt(int family, int type, int protocol) { // pydoc of this file third_party/python/Lib/test/support/__init__.py // this needs to happen right after socket is called or it won't work if (family == AF_INET || family == AF_INET6) { - unassert(__sys_setsockopt_nt(h, SOL_SOCKET, -5, &yes, 4) != -1); + unassert(__imp_setsockopt(h, SOL_SOCKET, -5, &yes, 4) != -1); } oflags = O_RDWR;