mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-29 16:52:28 +00:00
Introduce getcpu() system call from glibc
This commit is contained in:
parent
3eb405e0e2
commit
77a92f517b
7 changed files with 111 additions and 4 deletions
18
libc/nt/kernel32/GetNumaProcessorNodeEx.S
Normal file
18
libc/nt/kernel32/GetNumaProcessorNodeEx.S
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "libc/nt/codegen.h"
|
||||
.imp kernel32,__imp_GetNumaProcessorNodeEx,GetNumaProcessorNodeEx
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
GetNumaProcessorNodeEx:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
mov __imp_GetNumaProcessorNodeEx(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
mov x0,#0
|
||||
ret
|
||||
#endif
|
||||
.endfn GetNumaProcessorNodeEx,globl
|
||||
.previous
|
|
@ -135,6 +135,7 @@ imp 'GetModuleHandle' GetModuleHandleA kernel32 1
|
|||
imp 'GetModuleHandleEx' GetModuleHandleExW kernel32 3
|
||||
imp 'GetModuleHandleW' GetModuleHandleW kernel32 1
|
||||
imp 'GetNamedPipeInfo' GetNamedPipeInfo kernel32 5
|
||||
imp 'GetNumaProcessorNodeEx' GetNumaProcessorNodeEx kernel32 2
|
||||
imp 'GetNumberOfConsoleInputEvents' GetNumberOfConsoleInputEvents kernel32 2
|
||||
imp 'GetNumberOfConsoleMouseButtons' GetNumberOfConsoleMouseButtons kernel32 1
|
||||
imp 'GetOverlappedResult' GetOverlappedResult kernel32 4
|
||||
|
|
|
@ -118,6 +118,9 @@ bool32 GetSystemTimeAdjustment(uint32_t *lpTimeAdjustment,
|
|||
|
||||
void GetCurrentProcessorNumberEx(struct NtProcessorNumber *out_ProcNumber);
|
||||
|
||||
bool32 GetNumaProcessorNodeEx(const struct NtProcessorNumber *Processor,
|
||||
unsigned short *out_NodeNumber);
|
||||
|
||||
#if ShouldUseMsabiAttribute()
|
||||
#include "libc/nt/thunk/synchronization.inc"
|
||||
#endif /* ShouldUseMsabiAttribute() */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue