250 Commits

Author SHA1 Message Date
Travis Geiselbrecht
5dea3e1933 [warnings] fix a few warnings introduced with newer version of gcc
Most of the warnings are new, such as needing to mark fallthroughs on
cases explicitly. A few are based on signed vs unsigned comparisons.

Disable one warning that was annoying about comparing null to arguments
marked nonnull.
2018-03-15 14:10:12 -07:00
Erik Gilling
cc60328989 [cdcserial] Refactor driver to support multiple channels. 2018-01-22 23:33:35 -08:00
Will Drewry
1c59a73cb4 app/tests/port_tests.c: static-ify consts
This change makes the shared constants static
as well as const-ifies shared packets.
2017-12-22 16:12:36 -06:00
Will Drewry
0f939a52e9 app/tests/port_tests.c: fix bad indents 2017-12-22 15:19:00 -06:00
Will Drewry
e08ca47ff1 kernel/port.c: protect against port_create() race
In the current design, ports may be created with the same name
because of time-of-check-time-of-use behavior.

This change adds a new port magic, PORTHOLD_MAGIC, which cannot be
accessed using the normal accessors. It is injected into the list
upon a successful, locked search for a name.  It holds the name
until the allocation happens. At which point the port-hold is
deleted and the real port is added while, again, under the thread
lock.

This change assumes using a stack-allocated port is desirable over
preallocating and freeing on each port_create().  If the overhead
of allocation is low, then pre-allocating the new port would be
the cleanest option: (1) allocate, (2) check for collisions,
(3) add to list.

This fix is confirmed by the two_threads_race test completing its
256 iterations without a race. It also fixes the test to expect
ERR_BUSY and to exit cleanly, as it had never completed before.
2017-12-22 15:10:42 -06:00
Will Drewry
bc69dededf app/tests/port_tests.c: add two_threads_race test
This change adds a test to the port_tests suite
to trigger the port_create() race.  When tested with
an SMP (3) qemu instance, the race is discovered in
less than twenty iterations and often much sooner.
2017-12-22 14:55:17 -06:00
Girts
61d06e19fc [lib/cbuf] [app/tests] fix off by one in lib/cbuf. add a test.
Previously, if tail was == 0, and we wrote exactly enough bytes to
the end of the buffer, then head would end up at 0 as well. This
would make the buffer instaneously empty, as head == tail.
2016-11-01 21:54:23 -04:00
John Grossman
0c782aa381 [spelling] signalling --> signaling (#162)
Switch from the UK spelling of signalling (also, signalled and
signaller) to the American spelling.
2016-09-07 15:29:56 -07:00
klemens
d0b90c2d68 [spelling] spelling-fixes. (not external/) 2016-08-25 17:30:34 -07:00
Gurjant Kalsi
87b40fda48 [usb][usbtest] Fix compile error in USB test app (missing parameter).
Endpoint type was added to USBC (interrupt, bulk, isoc, etc) but usbtest app was not updated to reflect this.
2016-07-15 14:04:50 -07:00
Gurjant Kalsi
604a2bff74 [ndebug] Move ndebug reset handshake from user endpoint to all endpoints.
NDebug sits and waits for a reset message before becoming active. I intend to
use this handshake for the system debug protocol as well as the high level
protocol so I'm pulling the logic for it up into the core ndebug utility
functions.
2016-04-19 18:27:10 -07:00
Gurjant Kalsi
ce0a3db705 [cdcserial][usb] Add a CDC-Serial USB Class Driver. 2016-04-18 17:03:04 -07:00
Gurjant Kalsi
05c646a39a [ndebug] Setup NDebug endpoints and create a bidirectional serial pipe over USB. 2016-04-18 12:07:34 -07:00
Travis Geiselbrecht
2423845505 [merge] merge in cortex-m fpu support changes 2016-03-30 20:28:18 -07:00
Gurjant Kalsi
1fa7f2c977 [usb] Allow client code to specify USB endpoint type. 2016-03-28 21:21:21 -07:00
Travis Geiselbrecht
f92aad2622 [merge] merge master into the cortex-m fpu working branch 2016-03-28 19:09:40 -07:00
Gurjant Kalsi
7dd294a62d [dartuino][bootloader] Changes as per code review. 2016-03-28 12:04:08 -07:00
Gurjant Kalsi
b28f754f78 [dartuino][bootloader] Add some more tracing to fsboot, look for proper system image name. 2016-03-09 16:08:27 -08:00
Gurjant Kalsi
fe0ef0c255 [dartuino][bootloader] Add Filesystem Boot. 2016-03-09 15:23:44 -08:00
Gurjant Kalsi
a8be9611cc [dartuino][bootloader] Get Bootloader USB working. 2016-03-09 15:23:25 -08:00
Gurjant Kalsi
42e76b1fc7 [ports] Add an API to dynamically add/remove ports from a port group. 2016-02-23 14:23:25 -08:00
Travis Geiselbrecht
a4ca0a6e00 [vmm] move most users of arch_mmu_query directly to vaddr_to_paddr() 2016-02-14 12:45:53 -08:00
Travis Geiselbrecht
d569c090ea [vim] remove vim expandtab comments on most of the files 2016-02-14 12:32:07 -08:00
Travis Geiselbrecht
2eb32a4369 [style] mass reformat all the non external code to 4 space indents
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
2016-02-14 12:24:01 -08:00
Travis Geiselbrecht
a7496980c0 [lib][stdio] fix the build after -fbuiltin and io changes 2016-02-07 16:05:46 -08:00
Eric Holland
3d7e1f4968 [arch][arm] changes to support cortex-m0 architecture 2016-01-17 17:35:06 -08:00
Brian Swetland
20513a9901 [app][mdebug] add JTAG support
- initial gpio implementation
- runs at about 6MHz, not optimized or adjustable yet
2016-01-11 15:38:48 -08:00
Brian Swetland
8fbbaccb2b [app][mdebug] update protocol for JTAG transactions 2016-01-11 15:38:48 -08:00
Travis Geiselbrecht
75a8ce0f63 [merge] merge dartuino sensor development branch 2016-01-05 16:39:00 -08:00
Travis Geiselbrecht
9c74f98fa9 [merge] merge mips development branch
Add support for mips architecture.
Currently supports particular generic target on qemu.
2015-12-08 14:23:38 -08:00
Travis Geiselbrecht
720dc32335 [app][tests][clock_test] keep running the test after the first failure 2015-12-02 18:32:28 -08:00
Eric Holland
94e1825854 [accelerometer]added app for interacting with accelerometer from console 2015-12-02 18:13:54 -08:00
Carlos Pizano
c8ec0024da [kernel][port] port group test
A basic port watcher.

BUG=
R=travisg@google.com

Review URL: https://codereview.chromium.org/1478653002 .
2015-12-02 12:32:09 -08:00
Travis Geiselbrecht
4ab14424bd [cppcheck] clean up a few suggestions from cppcheck 2015-11-24 15:08:38 -08:00
Carlos Pizano
614eaf166a [kernel][ports] Add basic ports functionality
Missing mostly more tests, specifically group tests.

BUG=none
R=travisg@google.com

Review URL: https://codereview.chromium.org/1437453002 .
2015-11-20 14:43:27 -08:00
Travis Geiselbrecht
09acdf8afe WIP arm-m fpu 2015-11-11 18:07:07 -08:00
Travis Geiselbrecht
6475660350 WIP checkpoint 2015-11-11 13:22:07 -08:00
Travis Geiselbrecht
420c557c6e WIP fpu bits 2015-11-09 16:30:16 -08:00
Zhu, Bing
b6647f5bef [arch][x86][fpu]Change naming convention for FPU flag
To align with lk/arm flag naming convention, FPU flag
ENABLE_FPU is changed to X86_WITH_FPU

Signed-off-by: Zhu, Bing <bing.zhu@intel.com>
2015-11-09 22:14:11 +08:00
Travis Geiselbrecht
491e47fbc6 [linker] align special sections on native pointer bounary
This fixes a bug in x86-64 where it was trying to default align
input sections on 16 byte boundaries, which was screwing up the
padding between structures.
2015-11-06 12:00:04 -08:00
Travis Geiselbrecht
2c52edce0b [app][tests] set ENABLE_FPU in arch/x86 targets, enable floating point tests 2015-10-27 13:19:07 -07:00
Travis Geiselbrecht
114a350e55 [linker] align all the special sections on 8 byte boundaries, remove x86-64 hack
A bit overkill for 32bit machines, but aligning all the special data structures
on 8 byte boundaries removes any special case for 64bit machines.
2015-10-26 17:01:34 -07:00
Travis Geiselbrecht
0e1ce411ba [make] add ability to set EXTRA_LINKER_SCRIPTS in modules
This allows for individual modules to extend the main linker script,
primarily to add their own sections to interate over.
Remove the main shared_* linker scripts.
2015-10-26 16:47:18 -07:00
Travis Geiselbrecht
35ebee0e40 [merge] branch 'heapswitch'
This picks up the major work of allowing multiple heap implementations
and enable dlmalloc as an alternate heap to the simple existing one
(now called 'miniheap').

Also added a novm page allocator for memory management on systems too small
or missing an mmu to have a vm. Not much more than a simple bitmap allocator
that the heap pulls from. Allows for other heaps and/or users of physical
memory to coexist and span multiple banks of memory.
2015-10-20 16:53:00 -07:00
Travis Geiselbrecht
3b2d7a268b [make] remove the need for a module to manually add $(LOCAL_DIR)/include to the global include path
Pretty much every module in the system was already doing it, so do it
automatically.
2015-10-19 19:07:16 -07:00
Travis Geiselbrecht
38f20ec0a1 [lib][console] add pointer type arg, switch some users to it.
Patch courtesy Erik Corry
2015-10-19 12:49:20 -07:00
Gurjant Kalsi
dc079d7327 [console][uart][shell] Created a crash-time shell and a polling based UART driver to use on panic. 2015-10-12 16:38:51 -07:00
Carlos Pizano
13a1d4f530 [app][loader] Odds and ends
- Fix a bug when doing bounds checking
- Don't run elf if the entrypoint is out of bounds
- Allow to specify the memory slot to download (slot is 512K)
- Default slot for elf is 1, 3 and for data is 0, 2
2015-09-23 12:46:43 -07:00
Travis Geiselbrecht
215b5ed07f [64bit] fix a few more 64bit warnings in newer code 2015-09-20 13:11:51 -07:00
Travis Geiselbrecht
7c62a4923f [app][tests] run float_tests on arm64 as well 2015-09-20 12:13:07 -07:00