ssize_t is annoying with formatting, since %zd doesn't really know how
to match it, so the usual strategy is to use %ld, since ssize_t is
always defined as a signed long on LK.
Add a new API to bio layer(read_async) where function will
return immediately, and a callback function will be called from
interrupt context, when block driver completes the IO request.
This commit adds the VirtIO 9p device driver based on the VirtIO driver
stack in LK, `dev/virtio`. The driver supports a subset of 9P2000.L
protocol (https://github.com/chaos/diod/blob/master/protocol.md), which
is able to perform basic file operations (fread, fwrite, dirread, etc.).
The primary interface for sending and receiving the 9p messages is
`virtio_9p_rpc`, which is handy and scalable.
The driver is limited to communicate to the host with only one
outstanding 9p message per device due to the simplified driver design.
Basically that is enough for embedded environments when there is no
massive file IO.
Signed-off-by: Cody Wong <codycswong@google.com>
Add new feature bits for the net device
Since the new feature bits are >= 32, add support for reading higher
than 32bit feature words from the virtio mmio interface.
Nothing fundamentally changed, just update to new feature bits and print
them at device detection time.
Try to negotiate the guest feature set as well, though nothing
fundamentally changes at this time.
In the non VM path the existing routine wouldn't subtract from len, so
the function would (properly) return bytes transferred instead of zero.
The wrapping code was written to assume 0 and not bytes transferred,
which seemed like a workaround for broken code. Change the inner routine
to always return bytes transferred and adjust wrapper routines
accordingly.
From working with -Wpacked its clear that some of the virtio
structures are overly packed and result in bad codegen on particular
architectures such as riscv. Roll back from using packed but
statically assert that the sizes are correct for some future arch
where things naturally pack differently.
Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.
See scripts/codestyle
Preparation to allow other images to be presented to the display.
Separate definitions of display and image formats.
display_get_info no longer provides a framebuffer.
display_get_framebuffer allocates a framebuffer for convenience.
Review URL: https://codereview.chromium.org/1777783003 .
Ran everything through scripts/codestyle.space, which uses astyle
to generally follow K&R style.
Biggest non whitespace change is pulling brackets down on function
declarations, which I'm pretty ambivalent about, but astyle insists
on taking a stance
-Not optimized yet, but should be pretty complete. Tested against qemu.
-Add switches to qemu script to allow running with a tap interface.
-Enable minip by default on vexpress-a9 platform