mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Add scouts honor escape hatch for source embedding
This commit is contained in:
parent
c91b3c5006
commit
b4269930f7
547 changed files with 1516 additions and 944 deletions
|
@ -21,7 +21,7 @@
|
|||
#include "libc/runtime/internal.h"
|
||||
#include "libc/macros.h"
|
||||
.privileged
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Terminates process, ignoring destructors and atexit() handlers.
|
||||
/
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "libc/sysv/consts/nr.h"
|
||||
#include "libc/macros.h"
|
||||
.real
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Terminates program abnormally.
|
||||
/
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "ape/relocations.h"
|
||||
#include "libc/macros.h"
|
||||
.section .text.exit,"ax",@progbits
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Delegates to __cxa_atexit().
|
||||
/
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
#include "libc/notice.inc"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Uniquely identifies each artifact linked in an address space.
|
||||
__dso_handle:
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "libc/macros.h"
|
||||
#include "libc/notice.inc"
|
||||
.text.startup
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Intel Manual V.1 §10.2.3 - MXCSR Control and Status Register
|
||||
#define MXCSR_DE (1 << 1) /* Denormal Flag */
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Re-initializes FPU.
|
||||
fpreset:
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
.initbss 300,_init_g_argc
|
||||
g_argc: .quad 0
|
||||
|
|
|
@ -23,11 +23,12 @@
|
|||
#include "libc/runtime/internal.h"
|
||||
#include "libc/str/appendchar.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/str/tpenc.h"
|
||||
|
||||
/* TODO(jart): Make early-stage data structures happen. */
|
||||
#undef isspace
|
||||
#undef iswspace
|
||||
#define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r')
|
||||
#define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r')
|
||||
#define iswspace(c) isspace(c)
|
||||
|
||||
struct DosArgv {
|
||||
|
@ -37,14 +38,12 @@ struct DosArgv {
|
|||
wint_t wc;
|
||||
};
|
||||
|
||||
static textwindows void decodedosargv(struct DosArgv *st) {
|
||||
static inline textwindows void decodedosargv(struct DosArgv *st) {
|
||||
st->s += getutf16(st->s, &st->wc);
|
||||
}
|
||||
|
||||
static textwindows void appenddosargv(struct DosArgv *st, wint_t wc) {
|
||||
if (st->p < st->pe) {
|
||||
st->p += tpencode(st->p, st->pe - st->p, wc, false);
|
||||
}
|
||||
static inline textwindows void appenddosargv(struct DosArgv *st, wint_t wc) {
|
||||
AppendChar(&st->p, st->pe, wc);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Returns granularity of memory manager.
|
||||
getpagesize:
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "libc/runtime/internal.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/dce.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Decentralized function for process initialization.
|
||||
/
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
#define BYTES 64
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
#define BYTES 64
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
mapanon:push %rbp
|
||||
mov %rsp,%rbp
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "libc/sysv/consts/nr.h"
|
||||
#include "libc/macros.h"
|
||||
.text.startup
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Merges page table entries for pages with identical content.
|
||||
/
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
munmap: push %rbp
|
||||
mov %rsp,%rbp
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "ape/relocations.h"
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Loads all pages from program image into memory.
|
||||
peekall:.leafprologue
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Provides argv[0] The BSD Way.
|
||||
.initbss 300,_init___progname
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Supplies basename(argv[0]) The GNU Way.
|
||||
.initbss 400,_init_program_invocation_short_name
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "libc/runtime/mappings.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
.text.startup
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Cosmopolitan process entrypoint.
|
||||
/
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.yoink __FILE__
|
||||
.source __FILE__
|
||||
|
||||
/ Thunks free() if it's linked, otherwise do nothing.
|
||||
/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue