com_mainbus_cninit() and move these cn functions from cobalt/console.c
to dev/com_mainbus.c
- call cninit() only once
- remove unneeded includes
- use ANSI function decls
grow-down auto extend segment) by allocating segment sized at
current stack size limit, and offsetting requested/returned address
as required
due to how normal virtual memory management work, allocating the
full sized stack memory segment up-front actually requires exactly same
amount of VA space and physical memory as the Linux 'grow' scheme and the
'grow' scheme is quite a lot more difficult to use in applications correctly,
so it's not very apparent why Linux introduced this feature at all
this fixes Thomas Klausner's Heroes3 crash, and might also
fix PR 26687 by Jan Schaumann
in cpu_initclocks(9) via a callback function.
Fixes the "hardclock(9) is called before cpu_initclocks(9)" problem
reported by KIYOHARA Takashi on port-cobalt.
- Use bus_space(9) functions to access GT64111 registers and
add register definitions for GT64111 in gtreg.h.
(XXX this could be in sys/dev/marvell?)
- Move microtime(9) from machdep.c to clock.c, and read timer0 register
via a callback function. Also change microtime(9) like other ports
to guarantee that the time will be greater than the value obtained
by a previous call.
sd3(mpt0:0:1:0): unable to allocate scsipi_xfer
sd3: not queued, error 12
Havard Eidnes's analysis of this problem is that the scsipi_xfer pool is
competing for resources with other pools, including the the inode and vnode
pools which can grow quite large.
*_scsipi_cmd(): don't biodone the buffer if scsipi_make_xs() fails, let the
caller deal with the problem
start function of block devices drivers: dequeue the buffer after the
scsipi_command() call. If scsipi_command() fails with ENOMEM don't dequeue
the buffer, and schedule a callout to call the start function after
some delay.
scsipi_init(): prime the scsipi_xfer_pool with one page. This ensure that
there is always some scsipi_xfer to play with. If scsipi_command() fails
because of pool_get(), we're sure there will be resources available later,
when the pending commands have completed.
Reviewed by Jason Thorpe and Havard Eidnes.
Todo: remove the "unable to allocate scsipi_xfer" and "not queued, error %d"
printfs, but I choose to keep them for now, to help make sure the code does
what it should.