31 Commits

Author SHA1 Message Date
Alex Richardson
0fd355ea4b dlmalloc: fix -Wstrict-prototypes warning 2025-01-07 22:28:07 -08:00
Kelvin Zhang
7d77e28430 [app][uefi] Enable mspace feature on dlmalloc
This allows us to use an identitiy mapped piece of memory as the heap
for UEFI app. UEFI app's allocation would go from this heap.
2024-11-06 10:12:17 -08:00
Travis Geiselbrecht
0255d80bd0 [external][libfdt] rename a top level function that collides with the name of a structure
Fixes an issue when the header is compiled with C++.
2024-04-16 23:01:31 -07:00
Travis Geiselbrecht
414c1e2665 [external][libfdt] update libfdt to newest version
Update libfdt from https://github.com/dgibson/dtc at revision
855c934e26aeadb5bab878d1b148090af2480c90

Source is verbatim except moving headers into an include directory added
to the path.

Using 2-clause BSD option.
2024-04-16 23:01:26 -07:00
Travis Geiselbrecht
25ff64d4fd [libc] move sys/cdefs.h out of libm and into the main include path
More code is using it, so try to build a more standardized version of
it. For now, since most of the defines that are needed are similar to
lk/compiler.h, mostly reimplement in terms of those.
2024-02-27 00:12:15 -08:00
Alex Richardson
231f58903b [make][clang] Do not add unsupported warning flags
Currently, clang does not support the -Wno-nonnull-compare and
-Wmaybe-uninitialized warning flags so this adds lots of unknown warning
flag output for each compile job when not using GCC.
This commit adds a makefile macro to check for supported warning flags
and only adds them if the compiler actually supports them.
2023-06-01 17:50:50 -07:00
Akansh
28c615456c Fix CVE-2004-0230
Applied patch for CVE-2004-0230 in tcp_in.c which prevents RST Spoofing Attack (Denial of Service).
2023-06-01 12:43:56 -07:00
Alex Richardson
7b12b201fd [dlmalloc] Fix -Wnull-pointer-arithmetic
Arithmetic on a NULL pointer is undefined behaviour and could be used by
the compiler to optimize out the arithmetic. Use the integer expansion of
chunk2mem(0) instead to silence this warning:
`arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Wnull-pointer-arithmetic]`
2023-04-23 17:23:31 -07:00
Travis Geiselbrecht
415096a2bf [external][lib][fdt] update libfdt to newest version
Update libfdt from https://github.com/dgibson/dtc at revision
73590342fc85ca207ca1e6cbc110179873a96962

Source is verbatim except moving headers into an include directory added
to the path.

Using 2-clause BSD option.
2023-01-15 19:02:30 -08:00
Travis Geiselbrecht
6462cbf51c [arch][fpu] add ability to specify per file or module if code needs fpu
Have the arch define additional compiler flags to explicit support or
not support a floating point unit.

Add ability for modules to per file or for the whole module mark code
as needing floating point support.

Add default flags for arm64, riscv, and x86 toolchains.

Needed because gcc 12 is getting much more aggressive about using vector
instructions for non float code, so getting away with avoiding it was
no longer working.

Still not perfect: printf code is being compiled with float, so it's
possible to use floating point instructions inside core kernel or
interrupt handling code if a printf is used.

Possibly will have problems on architectures where mixing float and non
float code at the linker generates issues, but so far seems to be okay.
2022-07-17 16:32:24 -07:00
Travis Geiselbrecht
3ba03f7def [external][libm] add -Wno-maybe-uninitialized
Some older code triggers this warning on gcc 12.1.
2022-05-12 20:04:42 -07: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
fcb65c9a88 [dev/lib][warnings] fix -Wmissing-declarations warnings in dev/ and lib/ 2021-10-21 23:16:20 -07:00
Travis Geiselbrecht
ba530722f5 [warning] add -Wdouble-promotion
Mostly just a few warnings where things are promoted via passing floats to
printf. Those we should generally remove anyway because they're just
benchmarking code. Most things LK runs on either doesn't have float or
doesn't have double sized floats.
2020-07-25 17:16:22 -07:00
Travis Geiselbrecht
4edb93adde [lib][console] rename some console command types to be prefixed with console_
Some of the structures, notably 'cmd', in the lib console stuff are a
little too generically named and have collided with some other code
so prefix the names a bit more cleanly with console_

The change is largely mechanical, and folks with out of tree code can
easily switch by renaming:
cmd -> console_cmd
cmd_args -> console_cmd_args
cmd_block -> console_cmd_block
console_cmd -> console_cmd_func

Apologies if this breaks you but it should be pretty easy to fix.
2020-07-25 15:59:58 -07:00
Travis Geiselbrecht
f371fa246b [arch] move the atomic ops into a separate header
Now you need to include arch/atomic.h to get to the atomic routines.
This simplifies a recusion issue in the way arch/ops.h included
arch_ops. Also just generally makes things cleaner.
2020-05-16 15:05:34 -07:00
Travis Geiselbrecht
36fd4c3244 [external][libfdt] refresh copy of libfdt from upstream
Snapshot as of revision 62cb4ad286ff82648232f769f78401bf6b00deda
from https://github.com/dgibson/dtc
2020-04-05 19:16:46 -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
1b7a28efb8 [include][lk] fixup lk/ include path move 2019-06-19 19:46:11 -07: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
Travis Geiselbrecht
f92aad2622 [merge] merge master into the cortex-m fpu working branch 2016-03-28 19:09:40 -07:00
Erik Corry
6d0122b98e [heap] Add API used by Dartino to get arena list 2016-03-23 21:22:39 +01:00
cstout
5f050a570a [lib][libm] Add floorf and ceilf
Needed by skia.

R=travisg@gmail.com

Review URL: https://codereview.chromium.org/1734733002 .
2016-02-24 10:17:21 -08:00
Travis Geiselbrecht
a3da9e78a4 [lib][cksum] move into external/ 2016-02-20 11:31:51 -08:00
Travis Geiselbrecht
7c412c38d7 [lib][heap] move dlmalloc implementation to external/ 2016-02-20 11:31:51 -08:00
Travis Geiselbrecht
5e14990dbd [lib][libm] move to external/ 2016-02-20 11:31:51 -08:00
Travis Geiselbrecht
c5c59a4897 [lib][aes] move to external/ 2016-02-20 11:31:51 -08:00
Travis Geiselbrecht
e514030336 [lib][mincrypt] move to external/ 2016-02-20 11:31:51 -08:00
Travis Geiselbrecht
8c5d18280d [lib][miniz] move into external/ 2016-02-20 11:31:51 -08:00
Travis Geiselbrecht
cd3a87b962 [lib][lwip] move lwip into external/ 2016-02-20 11:31:51 -08:00
Travis Geiselbrecht
8fa95015b8 [lib][fdt] move to external/ 2016-02-20 11:31:50 -08:00