Commit Graph

22 Commits

Author SHA1 Message Date
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
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
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
Travis Geiselbrecht
efbd6b1892 [lib][cbuf] C++ header guard the cbuf header 2016-02-21 14:09:40 -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
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
b09eda2a24 [lib][cbuf] move cbuf header into the library, reformat with spaces 2015-09-07 16:50:23 -07:00
Travis Geiselbrecht
f1f57fb591 [lib][cbuf|watchdog] fix post smp spinlock code
Change-Id: I702c01539798daa5f5fb71c98a88a3c9c3fb86b2
2015-05-28 13:00:41 -07:00
Arve Hjønnevåg
2c9c5959e7 Merge branch 'master' of https://github.com/travisg/lk into smp
Change-Id: Iecb11d57b6f089234c0826932bdb229588939750
2015-05-18 16:49:37 -07:00
John Grossman
493b7667c1 [lk][cbuf] Add some features to cbufs
+ Tweak read so that passing NULL for the data buffer causes the read
  operation to consume bytes (move the read pointer) without copying
  the data.
+ Tweak write so that passing NULL for the data buffer causes the
  write operation to fill zeros instead of copying from a source
  buffer.
+ Add a peek operation which will fill out (up to) 2 iovec_ts with the
  contiguous regions of the cbuf which are ready to read.
+ Add a reset method which unconditionally consumes all of the data in
  the cbuf.
+ Write some documentation for the interface in the header file.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I2a2d2ab524449a10fa1e174500cd6dfa12a05a3f
2015-05-08 10:49:06 -07:00
Travis Geiselbrecht
8fb2c54304 [kernel] remove critical_section, move everything to spinlocks 2015-03-10 16:43:54 -07:00
Dima Zavin
e8a9b4b7a4 [libc] move tracing out of debug into separate trace.h
Change-Id: I7476fc17b587a0ea2a42cbe3d49b72063e4c5dc8
Signed-off-by: Dima Zavin <dima@android.com>
2013-08-05 10:04:29 -07:00
Travis Geiselbrecht
1fc901fd8c [lib][cbuf] add code to let you intialize a cbuf with a static buffer 2013-07-31 11:34:44 -07:00
Travis Geiselbrecht
7e9fa038c3 [libc] fixup users of newly modified stdio routines 2013-05-24 20:51:37 -07:00
Travis Geiselbrecht
c22f1ff168 [lib][cbuf] add byte optimized routines
For simple uart stuff, writing and reading one byte at a time
is a common use case. These optimized routines are substantially
more efficient.
2013-01-19 16:41:55 -08:00
Travis Geiselbrecht
9b961b4a34 [lib] run all of lib and include through astyle 2012-10-31 21:47:17 -07:00
Travis Geiselbrecht
97cfd0bfa4 [make] update all of the rules.mk to use the new module system 2012-08-31 15:52:24 -07:00
Kent Ryhorchuk
f08548f559 Expose cbuf_space_avail. Fix bug in it. 2012-07-17 09:46:40 -07:00
Travis Geiselbrecht
b1da117fdd [lib] remove assert.h from debug.h, which clears up an order of inclusion problem 2012-04-23 15:52:30 -07:00
Travis Geiselbrecht
a966b119f6 [lib][cbuf] simple circular buffer implementation 2009-06-28 12:24:07 -07:00