summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-04-19?a, ?c: fix macro debug printscinap_lenrek
2020-04-19?c: get rid of sprint(), strcpy() and strcat()/strncat(), cleanupcinap_lenrek
2020-04-19[257]l: cleanup fmt routines, replace sprint()cinap_lenrek
2020-04-19cc: cc.h changes needed by previous commitcinap_lenrek
2020-04-19?a, cc: fix buffer overflows in built-in preprocessor (macbody)cinap_lenrek
add a buffer size argument to macexpand() and check for overflow. check for overflow when parsing #include directives.
2020-04-19?a: catch symb[NSYMB] buffer overflow in lexer, cleanup, assume thechar is a ↵cinap_lenrek
rune
2020-04-19cc: get rid of sprint() and temporary buffer for type conversion fuctioncinap_lenrek
slookup() copies to symb, so use the symb[NSYMB] buffer directly to declare type conversion functions and get rid of the arbitrary sized local buffer. replace sprint() with snprint().
2020-04-19Make priority array max size explicit.Ori Bernstein
we were implicitly depending on UMINUS being the last entry in the operator table -- that's fragile.
2020-04-19fix cpp operator associativityOri Bernstein
We used to treat all operators as right associative, which means that we would evaluate them incorrecty. For example, '2 - 1 + 1' would evaluate as '2 - (1 + 2)', instead of '(2 - 1) + 1'. This adds an assoc parameter to struct pri, and then uses it to decide how to evaluate operators.
2020-04-19mergeOri Bernstein
2020-04-19dont overflow the stackOri Bernstein
when pushing expressions in cpp, particularly complex ones could overflow the stack and silently corrupt our data structures. add checks when we push, and bump the stack size up.
2020-04-19libmemdraw: remove inexistent build targetsrgl
2020-04-19mergecinap_lenrek
2020-04-19?c: fix Bconv() misusage of strncat()cinap_lenrek
2020-04-18fortunes: As much as I'd love to I feel I have to let it go -- rminnichstanley lieber
2020-04-196c: conserve registers for floating point operationscinap_lenrek
for floating point operations, reuse the return register on the right hand side if it has higher complex number than the left hand side to conserve registers. this makes the following code compile, that was previously run out of floating point register: float f(float r[15]) { return (r[0] + (r[1] * (r[2] + r[3] * (r[4] + r[5] * (r[6] + r[7] * (r[8] + r[9] * (r[10] + r[11] * (r[12] + r[13] * r[14])))))))); } the downside is that this produces extra move operations.
2020-04-18aux/getflags: support named flagsOri Bernstein
When using aux/getflags, it produces unnecessarily obscure names for the flags. This allows the caller of aux/getflags to support arbitrary names.
2020-04-187l, ql: dont assume . is in the path for running mkcname (thanks sam-d)cinap_lenrek
2020-04-18rc: fix code serialization for PIPEFD (thanks BurnZeZ)cinap_lenrek
BurnZeZ reported this the other day. It seems like if we have a pipeline that looks like: fn foo{cat < <{echo hi}} then the '<' will get merged in /env/'fn#foo'. This change fixes pcmd to add a space. It looks to me like this is the only token that can get merged this way by pcmd.
2020-04-17acme/win: pass on flags to winfs (fix undocumented -e flag)cinap_lenrek
2020-04-15ip(3): remove outdated maximum ipstack number limit.cinap_lenrek
the maximum number of ip stacks is a implementation detail of devip. it is 128 currently, instead of 16 as suggested in the manpage.
2020-04-13draw(3): typo dp23hiro
2020-04-12mergecinap_lenrek
2020-04-12kernel: remove unused mem2bl() prototypecinap_lenrek
2020-04-11mergeOri Bernstein
2020-04-11triple-click to select non-whitespace segmentOri Bernstein
The previous patch to plumb non-whitespace segments was confusing due to lack of visual feedback. This removes the empty selecton plumb behavior, and instead makes triple clicking work to get a plumbable selection.
2020-04-11mergecinap_lenrek
2020-04-11ip/ipconfig: ignore default routes targeting ourselfscinap_lenrek
when running ndb configuration, we might inherit the ipgw= attribute from the ipnet pointing to our own ip address (we are the default gateway). ignore such entries. do not add default routes with gateway equal to our own local (ip4) or link-local ip address (ipv6).
2020-04-11vt plumbing: don't require selectionOri Bernstein
Plumbing text in vt requires selecting the text that you want to plumb precisely. This patch makes plumbing behave the same way that it does in rio.
2020-04-11ip/ipconfig: resolve ipgw to an ip address as neccesary (thanks k0ga)cinap_lenrek
ndb(6) states that ipgw needs to be an ip address, however, attempting to resolve ipgw is not difficult and already done by ip/dhcpd.
2020-04-11vl: remove unused mysbrk() prototypecinap_lenrek
2020-04-11qa: remove ALLOC() and ALLOCN() macroscinap_lenrek
2020-04-11cc: remove mysbrk(), exponentially increase gethunk() allocation deltacinap_lenrek
mysbrk() was only used in gethunk() and should not be called by anyone, so dont export the symbol. simplify gethunk() using brk(). double allocation size on each call until we reach 1000*NHUNK. use signed long for nhunk as alignment rountin might make it negative and handle that case.
2020-04-116c: remove mystery sys.c filecinap_lenrek
2020-04-11cc, ?[acl]: fix gethunk() and move common memory allocator code to cc/compatcinap_lenrek
for gethunk() to work, all allocators have to use it, including allocations done by libc thru malloc(), so the fake allocation functions are mandatory for everyone. to avoid duplication the code is moved to cc/compat and prototypes provided in new cc/compat.h header.
2020-04-11backout the gethunk() again, as that breaks the assemblerscinap_lenrek
the assemblers share gethunk() cc/macbody but are compiled without compat.c, so calls such as getenv() trigger malloc() which does its own sbrk() calls, breaking the continuity of the hunk. so this change needs another revision. until then, this is backed out.
2020-04-10cc, ?l: fix gethunk() to actually grow allocationcinap_lenrek
the compilers and linkers use ther own memory allocator. free memory is between hunk and hunk+nhunk. allocation works by checking if nhunk is bigger or equal to the amount needed, and if not, repeatedly call gethunk() until there is. after that, the allocated amount is added from hunk and subtracted from nhunk by the user. the problem was when the needed amount was bigger than the default NHUNK size gethunk() allocates per call. gethunk() would not actually grow nhunk, but instead just set hunk and nhunk variables to the last allocated block. this resulted in a infinite loop of calls to gethunk() until sbrk() would hit the maximum size for the BSS segment. this change makes gethunk() actually grow the hunk space, increasing nhunk, and only updating hunk when nhunk was previously zero. we assume that mysbrk() retuns increasing addresses and that the space between the previous hunk+nhunk and the new block base returned by mysbrk() is usable.
2020-04-10mergecinap_lenrek
2020-04-10cc: backout gethunk() changecinap_lenrek
the real problem is that gethunk() does not grow the allocation but just allocates a new hunk, so repeated calls to gethunk() wont make nhunk grow to satisfy the allocation. this will be fixed in a upcoming commit.
2020-04-10cc, ?a, ?l: change thunk type to uintptrSigrid
2020-04-10cc: sbrk in bigger chunks as it grows, so it gets a chance to use the ↵Sigrid
ram/swap available
2020-04-10kernel: cleanup the software mouse cursor messcinap_lenrek
The swcursor used a 32x32 image for saving/restoring screen contents for no reason. Add a doflush argument to swcursorhide(), so that disabling software cursor with a double buffered softscreen is properly hidden. The doflush parameter should be set to 0 in all other cases as swcursordraw() will flushes both (current and previours) locations. Make sure swcursorinit() and swcursorhide() clear the visibility flag, even when gscreen is nil. Remove the cursor locking and just do everything within the drawlock. All cursor functions such as curson(), cursoff() and setcursor() will be called drawlock locked. This also means &cursor can be read. Fix devmouse cursor reads and writes. We now have the global cursor variable that is only modified under the drawlock. So copy under drawlock. Move the pc software cursor implementation into vgasoft driver, so screen.c does not need to handle it as a special case. Remove unused functions such as drawhasclients().
2020-04-09pc, pc64: remove "got unassigned irq" printscinap_lenrek
most pc's are multiprocessors these days, that use apic or msi interrupts, then the irq does not matter anymore. and uefi does not even assign irq to pci devices anymore. if we have a problem enabling an interrupt, we will print.
2020-04-089bootpxe: simplifycinap_lenrek
2020-04-089bootpxe: continues the war against random DHCPv6 DUIDscinap_lenrek
Some UEFI implementations use random UUID based DUID instead of ethernet address, but use ethernet derived link-local addresses. So extract the MAC from our IPv6 address.
2020-04-08/lib/face: add .dict entries for andrew.1 face filesAlex Musolino
2020-04-07notify(2): fix typoAlex Musolino
2020-04-06mergecinap_lenrek
2020-04-06pc64: remove rampage() nil checkcinap_lenrek
rampage() never returns nil
2020-04-06pc: zero rampage() memory (thanks LordCreepity)cinap_lenrek
memory returned by rampage() is not zeroed, so we have to zero it ourselfs. apparently, this bug didnt show up as we where zeroing conventional low memory before the new memory map code. also rampage() never returns nil.