Commit Graph

437 Commits

Author SHA1 Message Date
Travis Geiselbrecht
ad246760ff [c++] remove WITH_CPP_SUPPORT flag
Just always build with it enabled.
2019-07-13 17:41:25 -07:00
Travis Geiselbrecht
f880ff3615 [libc][c++] move __cxa_atexit into the eabi.c file to always be built
Even if C++ isn't active we still need it.
2019-07-13 17:10:06 -07:00
Travis Geiselbrecht
6cb02526b7 [include][console] split lib/console.h into two
TL;DR most uses of lib/console.h -> lk/console_cmd.h

Move the part that lets a piece of code somewhere in the system to
define a console command from the actual lib/console api to start an
instance of the console. Move in almost every place the user of the
console command definition to the new header, lk/console_cmd.h which is
always in the include path.

Also remove most uses of testing for WITH_LIB_CONSOLE since you can
almost always just safely define it and then let the linker remove it.
2019-07-13 16:56:33 -07:00
Travis Geiselbrecht
35a8d555a3 [include] move almost all of the remainder of top level includes into a subdir
Examples are include/platform.h -> platform/include/platform.h
include/target.h -> target/include/target.h

The old model generally considered these to be Always There includes,
but they're starting to stick out more and more so may as well actually
follow the model that most of the rest of the system follows.
2019-07-13 16:09:27 -07:00
Travis Geiselbrecht
3aecdda231 [includes] replace header guards with #pragma once 2019-07-13 15:46:16 -07:00
Travis Geiselbrecht
d10eb9a8f6 [libc] remove a few unused header files
strings.h and alloca.h are unused and a little funny anyway. Probably
were once used in an external library that's no longer in the tree.
2019-07-13 15:46:01 -07:00
Travis Geiselbrecht
cba9e47987 [license] replace the longer full MIT license with a shorter one
Used scripts/replacelic. Everything seems to build fine.
2019-07-05 17:22:23 -07:00
Travis Geiselbrecht
3699e45942 [include][lib] move most of the dangling top level include/lib/.h files into their lib
Only remaining one is console.h which is a little funny and will need to
be dealt with separately.
2019-06-19 22:44:15 -07:00
Travis Geiselbrecht
d8fa82cb91 [formatting] run everything through codestyle
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
2019-06-19 21:02:24 -07:00
Travis Geiselbrecht
1b7a28efb8 [include][lk] fixup lk/ include path move 2019-06-19 19:46:11 -07:00
Travis Geiselbrecht
42ddc062f3 [lib][gfx][mandelbrot] fix spelling, switch to single precision 2019-06-14 19:53:41 -07:00
Travis Geiselbrecht
2e417c0488 [lib][gfx][mandelbrot] make sure alpha channel is set
stm32f7 discovery board apparently requires the alpha channel to be set.
2019-06-10 17:10:42 -07:00
Travis Geiselbrecht
75b312b30b [lib][fs][spifs] abort cleanly on mount if device is null 2019-06-10 17:10:42 -07:00
Pibben
6a5f974ae9 [lib][bio] sub device inherits parent device erase_byte
Sub device inherits parent device erase_byte.
Nand flash device is with erase_byte = 0xFF, but in bio_publish_subdevice,
the sub device erase_byte will be with initial value 0.
When the image with the chunk of 0, the chunk is not written, but the
read value is 0xFF.

Signed-off-by: Pibben <pibben.tung@mediatek.com>
2019-04-10 01:58:12 -07:00
Travis Geiselbrecht
f98cef7992 [warnings] fix warnings across the entire code base
Fix or squelch all warnings in all code covered by buildall.
2018-12-16 17:33:22 -08:00
Travis Geiselbrecht
e608867d71 [libc] fix strncpy to zero out remaining space in the target 2018-12-16 17:23:56 -08:00
Travis Geiselbrecht
7bbf6d5831 [nit] fix extraneous trailing ; in CDECLS lines 2018-12-16 16:49:40 -08:00
Travis Geiselbrecht
8cf28bbdcf [arch][riscv] Initial port to a riscv32 sifive target
Currently targets qemu's sifive_e machine, which is a split flash/ram
machine, much like the Sifive HiFive1. Untested as of yet on a real
HiFive1.

Basic support including interrupts and architectural timers in place.
2018-12-16 16:44:23 -08:00
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
660c4ab08c [cdcconsole] Add TX buffering. 2018-01-30 20:34:34 -08:00
Erik Gilling
448f7a7aba [cdcconsole] Initial console over usb cdc serial. 2018-01-22 23:33:35 -08:00
Tristan Shieh
2a70c35d36 [lib][bio] fix compile warning with arch/arm64
lib/bio/bio.c:345:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Tristan Shieh <tristan.shieh@mediatek.com>
2017-10-23 00:21:16 -07:00
Peter Harliman Liem
a1cd66a0bd [lib][sysparam] free hexbuffer in error path 2016-12-11 14:37:41 -08: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
Girts
5b0f4d262b [lib/version] add a level of .phony indirection (#171)
Without this, the rule that depends on the generated file
gets rebuilt every time.
2016-10-07 12:03:21 -07:00
Girts
3972b18697 [make] [lib/version] remove a misplaced .PHONY (#170)
When lib/version was included, a rule depended on .PHONY.  This would
unexpectedly invoke other rules defined as dependent on .PHONY (standard
phony-ness signal).

As a side effect, this used to generate srcfiles.txt and
include_paths.txt in build dir. Since they are useful, we might always
build those anyway, and not make them phony at all.
2016-10-07 11:24:29 -07:00
Girts Folkmanis
fc611a8fda [lib/console] add "repeat" command.
Adds a repeat command with the following syntax:
  repeat <times> <delay in ms> <argv0> [<argv1> ...]
2016-09-30 10:38:10 -07: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
Eric Holland
d90cb4e7c6 [gfx] Add mandelbrot test to gfx routines (#149) 2016-08-12 10:28:12 -07:00
Erik Corry
4a553a7941 [pull][cmpctmalloc] Fix cmpctmalloc for large allocations (#147) 2016-06-21 09:35:40 -07:00
Gurjant Kalsi
5324238022 [ndebug] Move NDebug from main LK tree to Coral tree. 2016-06-06 10:21:04 -07:00
Gurjant Kalsi
bb4c6402b0 [console][io] Add an optional global input queue.
In this model, getc reads from a global input buffer and the uart posts data to this buffer.

This commit also enables the global input queue for STM32F7 and QEMU-Virt.

Tested on STM32F7/Dartuino and QEMU-ARM A15 with both CONSOLE_HAS_INPUT_BUFFER=1 and CONSOLE_HAS_INPUT_BUFFER=0
2016-06-02 16:01:56 -07:00
Søren Gjesse
6faa2957e1 [spifs] Fix warning with GCC 5.3.1
With GCC 5.3.1 (5-2016-q2-update from https://launchpad.net/gcc-arm-embedded)
additional warnings about unused variables cause compilation to fail.
2016-05-31 12:19:57 -07:00
Gurjant Kalsi
c19fcc5bb3 [spifs] Implement the ioctl to test whether or not the device is memory mapped. 2016-05-10 18:23:11 -07:00
Gurjant Kalsi
a63938a8c8 [fs] Add an ioctl to test if a file is memory mapped. 2016-05-10 18:22:44 -07:00
Gurjant Kalsi
62c4f983ef [bio] IOCtl to test whether the device is in linear mode. 2016-05-10 18:21:29 -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
05c646a39a [ndebug] Setup NDebug endpoints and create a bidirectional serial pipe over USB. 2016-04-18 12:07:34 -07:00
Gurjant Kalsi
44e74f0486 [dartuino][bootloader] Merge bootloader branch into master. 2016-03-28 12:05:20 -07:00
Travis Geiselbrecht
87bbe81050 [fs][fat] run astyle over the newly imported code to match LK style 2016-03-25 21:36:15 -07:00
Travis Geiselbrecht
4daede9164 [fs][fat] fail gracefully if the bdev passed in is null 2016-03-25 21:36:15 -07:00
Steve White
4263f92843 [fs][fat32] Adapt modern LK conventions 2016-03-24 14:15:20 -07:00
Steve White
97d1121f09 Merge branch 'master' into fatfs 2016-03-24 13:39:19 -07:00
Erik Corry
6d0122b98e [heap] Add API used by Dartino to get arena list 2016-03-23 21:22:39 +01:00
Steve White
5260d3d5f2 read only fat32 driver with long filename support. 2016-03-23 13:07:59 -07:00
cstout
c1255f7f47 [display] Refactor to avoid implicit framebuffer allocation.
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 .
2016-03-10 09:49:22 -08:00
Gurjant Kalsi
9ab4f51913 [dartuino][bootloader] Create a project for the bootloader. 2016-03-09 15:20:05 -08:00
Gurjant Kalsi
66b9d98a0e [fs][memfs] Add truncate functionality to memfs. 2016-03-02 10:47:55 -08:00
Gurjant Kalsi
f2dfd006c6 [fs][spifs] Add truncate functionality to spifs. 2016-03-02 10:47:50 -08:00