Travis Geiselbrecht
35da2d1260
[minip][dhcp] spiff up the state machine to handle more edge cases
...
-Add TAP option to scripts/qemux86
2021-12-31 17:23:57 -08:00
Travis Geiselbrecht
0617d6c845
[scripts][do-qemux86] add ability to set the network driver
2021-12-27 22:24:31 -08:00
Travis Geiselbrecht
caafb3e2ad
[dev][net][e1000] First stab at a working e1000 driver.
...
-Works against qemu's e1000 and e1000e driver.
-Untested on real hardware yet.
2021-12-27 22:24:31 -08:00
Travis Geiselbrecht
b5a9c2d8b2
[lib][minip] a few fixes
...
-Add C++ header guards around the public api.
-Fix a divide by zero bug in the test console routine.
-Add a new pktbuf api to assist with resetting a pktbuf back to default
values for reuse in an ethernet driver.
2021-12-27 22:24:31 -08:00
Travis Geiselbrecht
06105c5835
[lib][minip] fix a bug in the dhcp code
...
Minor bug where it would get the mac address out of sync with what the
hardware really has.
2021-12-27 22:24:31 -08:00
Travis Geiselbrecht
fb1e414a09
[dev][bus][pci] major refactor of the PCI bus driver
...
-Add a bus manager level, which is an object oriented walk of the pci
busses to build a per device object for later manipulation.
-Add features to enable MSI interrupts.
-Extend generic interrupt api to allow the platform to allocate vectors
for MSI interrupts.
-Rearrange a bit of the pc platform for the platform api changes.
-Add PC platform support for using the local apic to EOI MSI vectors.
-Fix up a few existing PCI drivers for small API changes.
-Add a few stubbed out routines for non PC platforms that use PCI.
2021-12-27 22:24:31 -08:00
Travis Geiselbrecht
522e62f648
[arch][x86][mmu] squelch an extraneous printf
2021-12-27 22:24:31 -08:00
Travis Geiselbrecht
be6169820d
[kernel][vm] Move the VM postheap init hook back one step
...
This is a cheesy solution to adding another top level hook, which really
should be done.
2021-12-27 22:24:31 -08:00
Travis Geiselbrecht
b74a4e33d4
[lib][cpp] add a auto_call class
...
useful for calling routines at the exit of a function.
2021-12-27 19:49:14 -08:00
Travis Geiselbrecht
fa9a0a0683
[lib][cpp] add a type_traits header
...
mostly for std::move and friends.
2021-12-27 19:49:09 -08:00
Travis Geiselbrecht
dd438d2f1f
[arch][test][mmu] add a simple test case to map a page and query the restult
...
Currently x86 fails the test but arm64 and riscv pass.
2021-12-05 23:24:04 -08:00
Travis Geiselbrecht
a01c181ea7
[arch][arm64] fix setting of UXN and PXN bits for NX permission
...
Previously would only set both UXN and PXN for no execute pages, but for
pages not marked no execute, neither bit was set. Change to mask out the
other privilege mode.
2021-12-05 23:22:54 -08:00
Travis Geiselbrecht
1a54b73e84
[arch][x86] don't set the G bit on inner page table entries
...
This is ignored on Intel cpus, but triggers a page fault on AMD cores.
2021-11-21 02:08:58 -08:00
Travis Geiselbrecht
a47cf76f14
[scripts][do-qemuarm] hard disable network if not selected
...
Turns out qemu was putting a e1000 nic on the PCI bus if no options were
selected. No reason to do so if the network is explicitly not called
for.
2021-11-20 17:42:41 -08:00
Travis Geiselbrecht
2bb32fe813
[libc][assert] add __PRINTFLIKE to assert_fail_msg()
...
Fix a warning as a result of this.
fixes issue #302
2021-11-12 22:07:14 -08:00
Travis Geiselbrecht
c9eae714db
[platform][qemu-virt-riscv] pick the PCIE ecam out of FDT and initialize PCI bus
2021-11-12 21:23:09 -08:00
Travis Geiselbrecht
3d95143d27
[platform][qemu-virt-arm] bootstrap pci from the FDT
...
Look up the ECAM information out of the device tree and bootstrap the
pci bus with it.
2021-11-12 21:08:35 -08:00
Travis Geiselbrecht
a23282cc30
[platform][pc] print some ACPI table information at boot
2021-11-12 21:07:53 -08:00
Travis Geiselbrecht
b01f7083eb
[lib][fdtwalk] add a callback hook to pass back pci-express information
...
At the moment only picks out the ECAM aperture and start/end bus
information, but enough to bootstrap the pci bus.
2021-11-12 21:05:40 -08:00
Travis Geiselbrecht
0c27d8fe45
[bus][pci] first stab at PCI-e ECAM support
2021-11-12 20:44:47 -08:00
Travis Geiselbrecht
7285a2d1fd
[bus][pci] convert the pci driver's back end to simple C++ objects
...
It was already rolling a vtable so go ahead and just implement it as
actual c++ objects.
2021-11-12 20:44:47 -08:00
Travis Geiselbrecht
0aba1b73cc
[bus][pci] trivially switch the PCI bus driver to c++
...
Just minimum to get it to build and work.
2021-11-12 20:44:47 -08:00
Travis Geiselbrecht
5b1041748e
[libc] flesh out inttypes.h a bit more
2021-11-12 20:44:47 -08:00
Michael Bishop
4e54f0fedc
[timer] make periodic timers more accurate
2021-11-12 19:31:27 -08:00
Travis Geiselbrecht
ff0f09ae4d
[lib][acpi_lite] add definition of MCFG table
...
MCFG describes the PCIe memory configuration region. Add support for
this table and print the information on boot on PC.
2021-11-11 01:00:18 -08:00
Travis Geiselbrecht
0cf8b5b3c6
[platform][pc] add acpi_lite to the build
...
Probe ACPI after threads are up and running. Does nothing at the moment
except probe.
2021-11-11 00:16:40 -08:00
Travis Geiselbrecht
9de18e0828
[lib][acpi_lite] get acpi_lite building and working
...
Didn't require much work to port to LK, since the zircon kernel is
fairly close.
Issue #310
2021-11-11 00:16:40 -08:00
Travis Geiselbrecht
7d95b64e7e
[lib][acpi_lite] import from fuchsia repository
...
Import verbatim at fuchsia repository at commit 645dbffdfbf52f72491187a1c59af1a677e3dd00
which is the initial commit before it was more excessively converted to
fuchsia style C++.
Issue #310
2021-11-11 00:08:33 -08:00
Travis Geiselbrecht
1550939102
[libc][inittypes] add entry for PRIxPTR
2021-11-11 00:03:39 -08:00
Travis Geiselbrecht
dbd1b6d903
[kernel][C++] add some simple C++ wrapper and RAII holders for various locks
...
Just a wrapper around mutex and spinlock for now.
2021-11-10 22:57:07 -08:00
Travis Geiselbrecht
98ca62d1e8
[build] c++filt the dump and size map as well
2021-11-10 01:35:32 -08:00
Travis Geiselbrecht
552606651c
[lib][console] include stdalign.h and use alignof/alignas
...
Instead of manually calling out the alignment to a void *, use alignas
to the real type.
2021-11-09 23:29:20 -08:00
Travis Geiselbrecht
b4e6747a62
[compiler.h] add __USED to all __SECTION entries
...
This keeps the compiler from eliding things that are explicitly placed
in particular sections that it thinks aren't used.
2021-11-09 23:29:20 -08:00
Mark Hill
31efe5fa5e
Fix module.mk to use the correct include flag
...
--include is not a real gcc flag. Maybe it exists for other compilers
or I'm just bad at reading docs though.
Anyway, now that this uses the expected gcc flag, `ccache` works when
added to this build system. Without this, `ccache` thinks there's
multiple input files and refuses to cache results. Now, it works and has
a great hit rate.
2021-11-09 22:36:26 -08:00
Travis Geiselbrecht
0257ac8c1f
[dev][pcnet32] get the pcnet32 driver building and working again
...
Not enabled by default since it uses the experimental driver api and
depends on lwip. But, builds and works if selected.
2021-11-09 00:44:55 -08:00
Travis Geiselbrecht
6fec0cb2bf
[scripts][x86] spiff up the qemu x86 script to handle a virtio disk and net device
2021-11-09 00:29:57 -08:00
Travis Geiselbrecht
a2b41c11d2
[dev][pci] move the pci console commands into the pci bus driver
...
Remove app/pcitests since it was just the console commands.
2021-11-09 00:19:53 -08:00
Travis Geiselbrecht
911900f3df
[arch][m68k] Merge in Motorola 68k port
2021-11-08 23:24:37 -08:00
Travis Geiselbrecht
445f3e4ee7
[platform/target][warnings] fix -Wmissing-declarations warnings in platform/ and target/
...
Mostly driver code in various platforms. There are still some warnings
in this part of the tree in lesser-used platforms.
2021-10-21 23:18:09 -07:00
Travis Geiselbrecht
75eaa5c489
[app][warnings] fix -Wmissing-declarations warnings in app/
2021-10-21 23:16:57 -07:00
Travis Geiselbrecht
fcb65c9a88
[dev/lib][warnings] fix -Wmissing-declarations warnings in dev/ and lib/
2021-10-21 23:16:20 -07:00
Travis Geiselbrecht
a895bcece5
[kernel][warnings] fix a few -Wmissing-declarations warnings in the kernel
2021-10-21 23:14:27 -07:00
Travis Geiselbrecht
a6ddffd80b
[arch][warnings] fix -Wmissing-declarations warnings
2021-10-21 23:08:38 -07:00
Travis Geiselbrecht
1e88a6c354
[build] add commented out -Wmissing-declarations
...
This is a useful warning to have on, but keep it off for now since there
are a ton of warnings here, and probably in external projects that use
LK.
CLs incoming to fix the most egregious warning violations this uncovers.
2021-10-21 23:05:24 -07:00
Travis Geiselbrecht
699842fad2
[dev][usb] fix a few unchecked mallocs and add some comments
...
A few routines had unchecked mallocs. One was unused, so remove it but
add fallback code for the rest of them.
2021-10-20 22:12:05 -07:00
Travis Geiselbrecht
daf1d671b5
[arch][arm-m] fix the pendsv handler for leaving a misaligned stack
...
The pendsv_ asm handler has been pushing 9 words on the stack prior to
calling into C code. This violates the ABI which requires 8 byte
alignment. It has worked mostly fine and thus hasn't been caught before.
Add an extra bump of the stack to align it after pushing the registers.
2021-10-17 23:01:37 -07:00
Travis Geiselbrecht
11a39f545b
[arch][arm] add debug asserts to the non SMP spinlock routines
...
This should assert that the spinlock is not already held when acquiring
and vice-versa and that interrupts are disabled.
2021-10-07 00:00:22 -07:00
Travis Geiselbrecht
e7c42e22ce
[arch][arm-m] Fix a bug with a mismatched acquire/release of the thread lock
...
Release the thread lock before context switching to a thread that was
preempted and thus not holding the thread lock. Add a few asserts to
make sure this invariant is maintained in the context switch and PENDSV
handler.
This has never mattered before because the thread lock (and other
spinlocks) were not being tested for validity on by definition single
processor cortex-m systems. After adding some code to test the
spinlocks' values this discrepancy was uncovered.
2021-10-07 00:00:22 -07:00
Travis Geiselbrecht
392dd18cfc
[external][ARM][CMSIS] save a copy of the CMSIS patch
...
Save a formatted patch of the last commit to help reapplying in the
future.
2021-10-07 00:00:22 -07:00
Travis Geiselbrecht
4e25fdd11b
[external][ARM][CMSIS] reapply the systick patch to cmsis
...
SysTick_Config() tries to set the systick priority to max. Comment out
this line since arch/arm/arm-m/arch.c sets the priority to medium to
compete with the rest of the exceptions in the system.
Also include lk/compiler.h to avoid redundant cmsis macros.
2021-10-07 00:00:22 -07:00