mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-24 06:49:02 +00:00
On Windows, mmap() now chooses addresses transactionally. It reduces the risk of badness when interacting with the WIN32 memory manager. We don't throw darts anymore. There is also no more retry limit, since we recover from mystery maps more gracefully. The subroutine for combining adjacent maps has been rewritten for clarity. The print maps subroutine is better This change goes to great lengths to perfect the stack overflow code. On Windows you can now longjmp() out of a crash signal handler. Guard pages previously weren't being restored properly by the signal handler. That's fixed, so on Windows you can now handle a stack overflow multiple times. Great thought has been put into selecting the perfect SIGSTKSZ constants so you can save sigaltstack() memory. You can now use kprintf() with 512 bytes of stack available. The guard pages beneath the main stack are now recorded in the memory manager. This change fixes getcontext() so it works right with the %rax register.
35 lines
761 B
C
35 lines
761 B
C
#ifndef COSMOPOLITAN_LIBC_CALLS_STRUCT_UCONTEXT_INTERNAL_H_
|
|
#define COSMOPOLITAN_LIBC_CALLS_STRUCT_UCONTEXT_INTERNAL_H_
|
|
#include "libc/calls/ucontext.h"
|
|
COSMOPOLITAN_C_START_
|
|
|
|
#ifdef __x86_64__
|
|
#define PC rip
|
|
#define SP rsp
|
|
#define BP rbp
|
|
#define RES0 rax
|
|
#define RES1 rdx
|
|
#define ARG0 rdi
|
|
#define ARG1 rsi
|
|
#define ARG2 rdx
|
|
#define ARG3 rcx
|
|
#define ARG4 r8
|
|
#define ARG5 r9
|
|
#elif defined(__aarch64__)
|
|
#define PC pc
|
|
#define SP sp
|
|
#define BP regs[29]
|
|
#define RES0 regs[0]
|
|
#define RES1 regs[1]
|
|
#define ARG0 regs[0]
|
|
#define ARG1 regs[1]
|
|
#define ARG2 regs[2]
|
|
#define ARG3 regs[3]
|
|
#define ARG4 regs[4]
|
|
#define ARG5 regs[5]
|
|
#else
|
|
#error "unsupported architecture"
|
|
#endif
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_UCONTEXT_INTERNAL_H_ */
|