Commit graph

5781 commits

Author SHA1 Message Date
cinap_lenrek 23d217afb4 devloopback: simplify loopoput()
remove unneeded waserror() block, loopoput is alled from
loopbackbwrite only so we will always get called with a
*single* block, so the concatblock() is not needed.
2016-11-07 22:08:21 +01:00
cinap_lenrek 857f2528e0 ip: always pass a single block to Medium.bwrite(), avoid concatblock() calls in Dev.bwrite()
the convention for Dev.bwrite() is that it accepts a *single* block,
and not a block chain. so we never have concatblock here.

to keep stuff consistent, we also guarantee thet Medium.bwrite()
will get a *single* block passed as well, as the callers are
few in number.
2016-11-07 22:05:29 +01:00
cinap_lenrek ea993877a9 ip/nullmedium: free passed block in nullbwrite() 2016-11-07 21:40:12 +01:00
cinap_lenrek 59dd0af53a ip/tcp: remove useless nil checks for padblock() and allocb() return value 2016-11-07 21:39:28 +01:00
cinap_lenrek c1fd7c210b kernel: fix missing ; in panic() call 2016-11-05 20:08:20 +01:00
cinap_lenrek 963497f06b kernel: avoid padblock copying for devtls/devssl/esp, cleanup debugging
to avoid copying in padblock() when adding cryptographics macs to a block
in devtls/devssl/esp we reserve 16 extra bytes to the allocation.

remove qio ixsummary() function and add acid function qiostats() to
/sys/lib/acid/kernel

simplify iallocb(), remove iallocsummary() statitics.
2016-11-05 20:05:40 +01:00
cinap_lenrek 240590ab0a archacpi: fix format string warning on amd64 2016-11-05 18:31:50 +01:00
cinap_lenrek fa5bd71218 devmnt: avoid memory copies of I/O rpc buffer by using bwrite()
given that devmnt will almost always write into a pipe
or a network connection, which supports te bwrite routine,
we can avoid the memory copy that would have been done by
devbwrite(). this also means the i/o buffer for writes
will get freed sooner without having to wait for the 9p
rpc to get a response, saving memory.

theres one case where we have to keep the rpc arround and
that is when we write to a cached file, as we want to update
the cache with the data that was written, but the user buffer
cannot be trusted to stay the same during the rpc.
2016-11-05 18:26:12 +01:00
cinap_lenrek 5c1feb0ef0 libc: move calloc() into its own compilation unit
move calloc() in its own compilation unit to avoid
code duplication. also, calloc() is used rarely in
plan9 programs.
2016-11-05 18:00:10 +01:00
cinap_lenrek bf9bada0c2 winwatch: put previous label contents in edit buffer for relabling 2016-11-01 09:50:25 +01:00
cinap_lenrek 95609d520e 8c: fix double compiling FNX complex lvalue in cgen64()
sugen() calls cgen64() speculatively so that when cgen64() returns
zero, it will fall back and compile 64-bit copy.

the bug was that cgen64() compiled the left hand side and then recursively
called cgen64() again, which didnt handle the memory copy so it returned
zero and sugen() would compile the left hand side again resulting in two
function calls being emited.

some code that reproduced the issue:

#include <u.h>
#include <libc.h>

typedef struct
{
	char x[10];
	vlong a;
} X;

X a;
X *f(void) { return &a; }

void
main(int argc, char *argv[])
{
	f()->a = a.a;
}

producing:

TEXT	f+0(SB),0,$0
	MOVL	$a+0(SB),AX
	RET	,
	RET	,
	TEXT	main+0(SB),0,$0
	CALL	,f+0(SB)
	CALL	,f+0(SB)			<- bug
	MOVL	AX,CX
	LEAL	a+12(SB),DX
	MOVL	(DX),AX
	MOVL	AX,12(CX)
	MOVL	4(DX),AX
	MOVL	AX,16(CX)
	RET	,
	GLOBL	a+0(SB),$20
	END	,
2016-10-30 23:30:13 +01:00
cinap_lenrek 62d3108646 ape/libsec: add secp384r1 curve parameters for tls 2016-10-30 20:32:03 +01:00
cinap_lenrek ef8cbbba03 merge 2016-10-30 02:17:12 +01:00
cinap_lenrek c9d55cadb3 libsec: add secp384r1 curve parameters for tls 2016-10-30 02:15:40 +01:00
spew cf5d24033d winwatch: no more 'l' key labeling 2016-10-26 14:01:13 -05:00
spew d5992857bb winwatch: middle mouse button click also prompts for label 2016-10-25 22:53:38 -05:00
ftrvxmtrx 7b8c6ae432 stats: alternatively read battery and temp from aux/acpi 2016-10-24 23:51:16 +02:00
ftrvxmtrx 1f3600c83f aux/acpi: make it stats(8)-friendly 2016-10-24 23:50:04 +02:00
cinap_lenrek 234137bce3 fix bugs and cleanup cryptsetup code
devfs:

- fix memory leak in devfs leaking the aes key
- allocate aes-xts cipher state in secure memory
- actually check if the hexkey got fully parsed

cryptsetup:

- get rid of stupid "type YES" prompt
- use genrandom() to generate salts and keys
- rewrite cryptsetup to use common pbkdf2 and readcons routines
- fix alot of error handling and simplify the code
- move cryptsetup command to disk/cryptsetup
- update cryptsetup(8) manual page
2016-10-24 20:56:11 +02:00
cinap_lenrek f3feafc476 auth/factotum: bound the number of srv processes to 16, error the 9p rpc when it is over limit 2016-10-23 17:18:35 +02:00
cinap_lenrek b728f50a79 lib9p: limit the number of srv processes kept arround 8 2016-10-23 17:16:22 +02:00
cinap_lenrek 98dba9a4a3 pc/archacpi: don't do acpi initialization in the kernel, provide generic acpimem routines
get rid of _INI and _REG method calls, this is not full acpi environment
anyway and all we really want todo at kernel boot time is figuring out
the interrupt routing. aux/acpi can try to enable more stuff if it needs
to later when battery status desired.

dont snoop memory space regions in amlmapio(), this is just wrong as
amlmapio() is *lazily* mapping regions as they are accessed, so the
range table would never be really complete. instead, we provide generic
access to the physical address space, excluding kernel and user memory
with acpimem file.
2016-10-23 04:09:27 +02:00
cinap_lenrek 055f837043 ip: simplify code as packblock() and concatblock() will never error 2016-10-23 00:31:42 +02:00
cinap_lenrek 75c6ab45e0 devip: simplify ipbwrite() by using retun value of qbwrite() 2016-10-23 00:29:41 +02:00
cinap_lenrek ef5c862ce9 ip/icmp: only reply to echo request when directed to us and source is unicast 2016-10-23 00:25:17 +02:00
cinap_lenrek a8d00e5d56 gif: just read and decode the first image when -9 or -c flag is specified 2016-10-22 00:35:17 +02:00
cinap_lenrek 6d97f77c2d libdraw: avoid dropping queued button change mouse events in emouse() 2016-10-22 00:04:21 +02:00
cinap_lenrek e5dc3ade08 mothra: avoid flushimage() calls, event() will implicitely flush 2016-10-22 00:02:23 +02:00
spew 3145ca7d78 mpc: remove unused yylval type 2016-10-19 22:15:51 -05:00
ftrvxmtrx 26e00d014c aux/acpi: batteries and CPU temp reading so far 2016-10-18 23:05:09 +02:00
ftrvxmtrx e01577f8f6 archacpi: optionally export acpi memory regions; properly initialize environment 2016-10-18 23:04:19 +02:00
ftrvxmtrx 06dd182695 sam: revert showdata crap 2016-10-18 21:25:19 +02:00
ftrvxmtrx d010b87b18 sam: corner cases are hard 2016-10-18 20:27:08 +02:00
ftrvxmtrx e19308ee16 sam: fixup :( 2016-10-18 20:22:25 +02:00
ftrvxmtrx dff69d5922 samterm: support "showdata" plumb action 2016-10-18 20:02:01 +02:00
stanley lieber 40f69f4df5 fortunes: does that me a dipshit 2016-10-16 14:16:17 -04:00
ftrvxmtrx 0a7a717525 scram: remove _PTS(5). it just doesn't make any sense 2016-10-15 23:42:22 +02:00
ftrvxmtrx 277913c94a scram: oops. word is 0xffff, not 0xff 2016-10-15 23:34:08 +02:00
ftrvxmtrx 375ad2d3ab scram: run _PTS(5) and disable GPEs before entering S5. x200s shuts down properly now 2016-10-15 23:10:53 +02:00
stanley lieber 7392dce0a7 fortunes: Angular uses the term "scope" in a manner akin to the fundamentals of co
mputer science.
2016-10-10 13:43:48 -04:00
BurnZeZ b563ed7550 iwhois(1): make -n work, add .org, and a couple minor changes 2016-10-03 12:31:48 -04:00
cinap_lenrek 062a46607e nusb/kb: set usage to 0 (undefined) for items exceeding usage list 2016-09-28 19:25:23 +02:00
cinap_lenrek 9cb3e5900e nusb/lib: fix wrong endpoint id when openep() finds already existing endpoint file 2016-09-28 19:15:10 +02:00
ftrvxmtrx ab3492f05e sam: putenv("%", ...): don't crash when no file is current 2016-09-26 23:00:06 +02:00
cinap_lenrek d8b4f95476 sam: use $% instead of $f for filename to be consistent with acme 2016-09-22 11:04:43 +02:00
cinap_lenrek 52cacba37c sam: make current filename available to shell commands in $f (thanks aiju) 2016-09-22 10:49:48 +02:00
cinap_lenrek 483e54a0d3 ip(3): spelling, thanks sl 2016-09-21 21:57:08 +02:00
cinap_lenrek e864523eed ip(3): update description of /net/ipifc/*/status format 2016-09-21 21:47:52 +02:00
cinap_lenrek c7bad8f0e5 rio: fix onscreen() 2016-09-20 09:15:53 +02:00
cinap_lenrek 35fde3591f scat: hjdicks for amd64 2016-09-19 19:04:21 +02:00