mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Add pipelining to cocmd
This commit is contained in:
parent
b4e38851ff
commit
aa34340f3d
4 changed files with 90 additions and 68 deletions
|
@ -26,12 +26,6 @@
|
|||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
|
||||
static char *_stkbase;
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
_stkbase = (char *)kFixedmapStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates stack.
|
||||
*
|
||||
|
@ -47,13 +41,12 @@ __attribute__((__constructor__)) static void init(void) {
|
|||
*/
|
||||
void *_mapstack(void) {
|
||||
char *p;
|
||||
if ((p = mmap(_stkbase, GetStackSize(), PROT_READ | PROT_WRITE,
|
||||
MAP_STACK | MAP_ANONYMOUS | MAP_FIXED, -1, 0)) != MAP_FAILED) {
|
||||
if ((p = mmap(0, GetStackSize(), PROT_READ | PROT_WRITE,
|
||||
MAP_STACK | MAP_ANONYMOUS, -1, 0)) != MAP_FAILED) {
|
||||
if (IsAsan()) {
|
||||
__asan_poison(p + GetStackSize() - 16, 16, kAsanStackOverflow);
|
||||
__asan_poison(p, 4096, kAsanStackOverflow);
|
||||
}
|
||||
_stkbase += GetStackSize() * 4;
|
||||
return p;
|
||||
} else {
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue