Commit graph

4589 commits

Author SHA1 Message Date
cinap_lenrek ef647a54c0 kernel: cannot interrupt segmentio commands
once we submit a command to segmentio process, we have to wait
for it to complete even if we got interrupted.
2015-04-16 16:07:36 +02:00
cinap_lenrek 39cf6b34e3 kernel: avoid posting note to kernel process in faulterror()
the intend of posting a note to the faulting process is to
interrupt the syscall to give the note handler a chance
to handle it. kernel processes however, have no note handlers
and all the postnote() does is set up->notepending which will
make the next attempt to sleep raise an Eintr[] error. this
is harmless, but usually not what we want.
2015-04-16 15:31:51 +02:00
cinap_lenrek 433b18ec2b cc: catch non constant pointer initializers
char	FOO[] = "abc";	/* ok */
char	*BAR = FOO;		/* ok */
char	*BAZ = BAR;		/* wrong */
2015-04-16 14:32:42 +02:00
cinap_lenrek 3d4fcc6c8a sokoban: fix non constant inializer 2015-04-16 14:29:13 +02:00
cinap_lenrek bcf54c0bfb kernel: pass segio error string by pointer
there's no need to waste space for a error buffer in the Segio
structure, as the segmentio kproc will be waiting for the next
command after an error and will not overwite it until we issue
another command.
2015-04-16 01:20:30 +02:00
cinap_lenrek 46070c3122 kernel: add segio() function for reading/writing segments
devproc's procctlmemio() did not handle physical segment
types correctly, as it assumed it can just kmap() the page
in question and write to it. physical segments however
need to be mapped uncached but kmap() will always map
cached as it assumes normal memory. on some machines with
aliasing memory with different cache attributes
leads to undefined behaviour!

we borrow the code from devsegment and provide a generic
segio() function to read and write user segments which
handles all the cases without using kmap by just spawning
a kproc that attaches the segment that needs to be read
from or written to. fault() will setup the right mmu
attributes for us. it will also properly flush pages for
segments that maintain instruction cache when written.
however, tlb's have to be flushed separately.

segio() is used for devsegment and devproc now, which
also allows for simplification of fixfault() as there is no
special error handling case anymore as fixfault() is now
called from faulting process *only*.

reads from /proc/$pid/mem can now span multiple pages.
2015-04-16 00:45:25 +02:00
cinap_lenrek 88d7d8428a upas/smtp: cleanup mkfile
no need to list headers explicitely as they are implied by $HFILES.
2015-04-15 01:59:17 +02:00
cinap_lenrek 35e1aa1bfa segment: don't store pointers in a long 2015-04-13 23:35:36 +02:00
cinap_lenrek 656dd953a8 segment: fix read/write g->dlen race, avoid copying kernel memory, qlock
code like "return g->dlen;" is wrong as we do not hold the
qlock of the global segment. another process could come in
and override g->dlen making us return the wrong byte count.

avoid copying when we already got a kernel address (kernel memory
is the same on processes) which is the case with bread()/bwrite().
this is the same optimization that devsd does.

also avoid allocating/freeing and copying while holding the qlock.
when we copy to/from user memory, we might fault preventing
others from accessing the segment while fault handling is in
progress.
2015-04-13 23:18:56 +02:00
cinap_lenrek 85e144dcb0 zynq: invalidate cache before booting cpu1
sometimes, machine would crash on boot because
of data cache inconsistency. invalidating the
cache before booting cpu1 fixes it.
2015-04-13 23:04:53 +02:00
cinap_lenrek a43321946e segment: speed up fixedseg() doing single pass over freelist
walking the freelist for every page is too slow. as we
are freeing a range, we can do a single pass unlinking all
pages in our range and at the end, check if all pages
where freed, if not put the pages that we did free back
and retry, otherwise we'r done.
2015-04-12 18:08:06 +02:00
cinap_lenrek 98a7eae9c0 segment(3): document fixed segment creation 2015-04-12 16:38:39 +02:00
aiju d9880518f0 merge 2015-04-12 16:16:19 +02:00
cinap_lenrek a079cd1a3a merge 2015-04-12 16:06:28 +02:00
cinap_lenrek 647a1da108 segment: fix print buffer overflow, map fixed segments uncached, add to zynq kernel 2015-04-12 16:05:05 +02:00
cinap_lenrek 81e6b7e9c9 merge 2015-04-12 22:31:34 +02:00
cinap_lenrek 461c2b68a1 kernel: fixed segment support (for fpga experiments)
fixed segments are continuous in physical memory but
allocated in user pages. unlike shared segments, they
are not allocated on demand but the pages are allocated
on creation time (devsegment). fixed segments are
never swapped out, segfreed or resized and can only be
destroyed as a whole.

the physical base address can be discovered by userspace
reading the ctl file in devsegment.
2015-04-12 22:30:30 +02:00
aiju e8221d07d8 games/gb: improve sound emulation by modelling analog behaviour 2015-04-12 14:55:25 +02:00
stanley lieber d009b0013d nintendo(1), qer(8): fix typos 2015-04-11 23:34:25 -04:00
aiju 2a1d369281 games/gb: limit audio range to prevent clipping 2015-04-11 16:07:15 +02:00
stanley lieber aadbcf0a32 nintendo(1): update for gbc compatability 2015-04-10 18:32:22 -04:00
cinap_lenrek 5951073a57 merge 2015-04-11 22:05:00 +02:00
cinap_lenrek 771cb2a9cb ether82563: work arround bad eeprom checksum for some i218 card (thanks BurnZeZ)
on some machines, the eeprom checksum reads out as 0x3ABA
because of some bios issue. adding a flag for ignoring the
checksum and on i218 controllers.
2015-04-11 22:03:47 +02:00
stanley lieber 61f826d45f mothra(1): replace code.google.com with code.9front.org 2015-04-10 15:00:05 -04:00
cinap_lenrek 74b37c286f bootrc: simplify bootargs splitting avoiding awk 2015-04-09 15:36:20 +02:00
cinap_lenrek 5fd97c7d60 pc, pc64: remove PCICONS debug buffer from pci.c 2015-04-09 14:55:01 +02:00
cinap_lenrek ca4e12839a pool: avoid triggering assert(b->magic != FREE_MAGIC) in blocksetsize() for mallocalignl()
when we trim the front of a block with freefromfront(),
the block magic of the back was not initialized which
could sometimes trigger the assert in blocksetsize()
to fail. fix is to just move the initialization of the
magic field before the blocksetsize() call.

the second b->magic = UNALLOC_MAGIC isnt really required
but just done for consistency with the trim() code above.
2015-04-08 21:04:10 +02:00
cinap_lenrek adfb8dff26 nusb/kb: always try to recover on error, fix recover for multi-function devices
when we get an i/o error, always call hdrecover() which
will reset the port and reinitialize the interface of
the calling processes endpoint.

handle the case when we have multi-function device with
multiple reader procs in hdrecover(). the sequence is
as follows:

1) any of the reader procs encounters i/o error and calls hdrecover(),
acquires qlock and initiates port reset.
2) any other readerprocs will now encounter i/o error (due to reset) and also call
hdrecover() but will be waiting on the qlock for reset to complete.
3) first process completes reset and reinitializes its interface with setproto()
and then releases the qlock for the other readers todo the same.
2015-04-08 18:07:16 +02:00
cinap_lenrek fcd45e0cdd pci: just in case the bios is drunk 2015-04-08 03:46:49 +02:00
cinap_lenrek b7ceab84d3 pc, pc64: handle 64-bit pci membars
this avoids listing the upper half of 64-bit membars
in Pcidev.mem[] array avoiding potential confusion
in drivers.

we also check if the upper half is programmed to zero
by bios and otherwise zap the entry in Pcidev.mem[]
and print a warning.
2015-04-08 03:34:08 +02:00
cinap_lenrek fba26da490 pc, pc64: extend initial memory map for qemu multiboot data
qemu puts multiboot data after the end of the kernel image, so
to be able to KADDR() that memory early, we extend the initial
identity mapping by 16K. right now we just got lucky with
the pc kernel as it rounds the map to 4MB pages.
2015-04-08 02:50:09 +02:00
mischief 853823f435 pc: import intel i218 nic changes from 9atom 2015-04-07 11:38:48 -07:00
cinap_lenrek 49fe7b0dd0 kernel: move arrow cursor definition to port/devmouse.c 2015-04-07 22:05:48 +02:00
cinap_lenrek 39c3bc277d sgi: disable graphical arcs console printing on screen modeset
when we switch to graphics mode, we do not want graphical arcs console
to print on the screen anymore as it assumes 8bit color mode and just
messes up the screen on kernel prints.
2015-04-07 22:02:57 +02:00
stanley lieber 067e035fff /lib/rob: Да! 2015-04-02 18:56:31 -04:00
cinap_lenrek 022856f94e sgi: keyboard, mouse and cursor for indy 2015-04-02 18:35:43 +02:00
aiju d9af840ca2 games/gb: improved audio code 2015-04-02 15:30:12 +02:00
cinap_lenrek ec8d0d9e80 merge 2015-04-02 05:31:23 +02:00
aiju 8e588754bc games/gba: fix -3 crash and prevent >100% speed 2015-04-02 22:09:34 +02:00
cinap_lenrek ba7fbf0114 audiohda: add AMD FCH Azalia Controller (thanks qeed) 2015-04-02 05:30:00 +02:00
aiju 52ab0d1534 games/gb: fix gbc dma 2015-04-01 19:27:52 +02:00
aiju 66c98fab71 games/gb: fix -2/-3 2015-04-01 19:02:03 +02:00
aiju edfdc4ac07 new games/gb: better emulation and gbc support 2015-04-01 16:17:17 +02:00
cinap_lenrek 0b001e265c ether8169: fix Macv45 2015-04-01 15:22:37 +02:00
cinap_lenrek 0f785af644 ether8169: add 8168GU mac id (thanks qeed) 2015-04-01 14:58:29 +02:00
aiju 86bfd0331d games/c64: writes to I/O area do not affect underlying memory (documentation lied) 2015-04-01 12:49:59 +02:00
cinap_lenrek 2d0088598b devkbd: remove kbdputc() unused definition. 2015-04-01 12:21:11 +02:00
cinap_lenrek 736df3bd6c devkbd: remove unused constants 2015-04-01 12:15:54 +02:00
cinap_lenrek 3b08fd0769 merge 2015-04-01 01:32:37 +02:00
aiju 277185b51d games/gba: remove debugging print 2015-04-01 22:16:52 +02:00