Commit Graph

1554 Commits

Author SHA1 Message Date
dholland 62d11b422e Move struct salfs back inside libsa now that lfs_accessors.h is separate. 2015-07-28 05:13:14 +00:00
dholland 34f0d74c9e Add a new lfs header file: lfs_accessors.h.
This contains all the accessor functions and macros out of lfs.h.
Add an include of lfs_accessors.h after all uses of lfs.h... except
for code that wants to define its own struct lfs-alike that the
accessors are supposed to play along with. For these, set STRUCT_LFS
and include lfs_accessors.h after the necessary structure has been
defined, so that lfs_accessors.h can emit functions in terms of it.
2015-07-28 05:09:34 +00:00
isaki b0705370de white space -> tab. 2015-07-25 07:06:11 +00:00
dholland f59b8f4b3a Switch to accessor functions for elements of the LFS on-disk
superblock. This will allow switching between 32/64 bit forms on the
fly; it will also allow handling LFS_EI reasonably tidily. (That
currently doesn't work on the superblock.)

It also gets rid of cpp abuse in the form of fake structure member
macros.

Also, instead of doing sleep/wakeup on &lfs_avail and &lfs_nextseg
inside the on-disk superblock, add extra elements to the in-memory
struct lfs for this. (XXX: these should be changed to condvars, but
not right now)

XXX: this migrates a structure needed by the lfs code in libsa (struct
salfs) into lfs.h, where it doesn't belong, but for the time being
this is necessary in order to allow the accessors (and the various
lfs macros and other goop that relies on them) to compile.
2015-07-24 06:56:41 +00:00
dholland 656ac806f0 Rearrange the structures in the lfs bootbollocks slightly.
This generates the same output (at least on amd64) but will be more
robust until we're ready to deploy lfs64 bootblocks too.

XXX: I don't think these actually work right now, and the logic for
picking between v1 and v2 lfs formats (which is not related to ffsv1
vs. ffsv2) is definitely broken. But I haven't made it any worse.
2015-07-24 06:53:24 +00:00
matt c98065b9f6 If the platform support popcount as a __builtin, use that in preference
to the libc versions.
2015-05-29 19:38:59 +00:00
matt 71577e7b2d Use ARM_ENTRY since these aren't thumb compatible. 2015-05-25 18:41:08 +00:00
christos 925d349b50 tricks with sizeof() make coverity complain. 2015-05-09 18:49:36 +00:00
riastradh 7fd36dbc4a Add container_of to libkern.
Given x = &c->f, container_of(x, T, f) yields c, where T is the type
of c.

Discussed on tech-kern a while ago:

https://mail-index.netbsd.org/tech-kern/2013/03/21/msg015131.html
2015-04-20 15:22:17 +00:00
mrg 2603e0673f remove various HAVE_GCC=45 fragments. 2015-04-15 19:13:46 +00:00
joerg 72523275ec Provide _Unwind_Find_FDE for libgcc_s compatibility. 2015-02-17 21:02:33 +00:00
joerg 1c5d00e7d3 Force FPU support for Clang, don't disable IAS completely. 2015-01-29 20:45:16 +00:00
joerg e9d4ea8b6a Fix binary search when search value is in the last block, but not equal
to the start of the range. PR 49444.
2015-01-29 20:05:56 +00:00
christos d36e0de1e1 strtoi and strtou for the kernel 2015-01-16 18:36:31 +00:00
christos 96739e65c5 bcdtobin and bintobcd are now inlines in <dev/clock_subr.h> 2014-11-20 16:25:16 +00:00
christos 035b9a6c6d prefer our own unwind.h 2014-10-23 17:51:22 +00:00
joerg 5e9701e670 Introduce a separate bit mask for the return address. Use it on HPPA. 2014-09-27 12:08:46 +00:00
matt 6cf6fe02a9 New files for Userland support of UCB RISC-V (both 32-bit and 64-bit) 2014-09-19 17:36:24 +00:00
joerg 35d69bab34 Revert 1.33 and 1.34 for now, until either .INVISIBLE is reinstanciated
or random.S dropped.
2014-09-08 12:12:19 +00:00
matt 27620987b8 New files for OR1K support 2014-09-03 19:34:25 +00:00
matt a23afddde6 Add OR1K support 2014-09-03 19:27:21 +00:00
matt 905f9a1ab9 Make random.S invisible for coldfire too (e.g. anything not "m68k") 2014-09-01 07:32:35 +00:00
tsutsui 1a8dd01ee2 Revert stupid and untested changes. There was no extra copy in the macros.
Christos, you should reread our commit guideline as a Core member.
2014-08-30 14:24:02 +00:00
christos c30be26b21 remove extra copy of the macro. 2014-08-30 13:09:27 +00:00
tsutsui e58317de49 Rename padding macros to reflect and clarify the original intention.
No binary changes on luna68k (which has -DLIBSA_PRINTF_WIDTH_SUPPORT).
2014-08-30 12:23:38 +00:00
christos 2fac5fd5c7 use .INVISIBLE to hide random.S, instead of extra rules. 2014-08-27 08:51:37 +00:00
tls ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
isaki 7b2cf7659d Unify all arch/*/stand's atoi() to MI libsa.
lib/libsa/atoi.c was separated from lib/libsa/bootcfg.c.
PR/49084
2014-08-10 07:40:49 +00:00
matt 547b3a3b01 Changes to existing files to enable building AARCH64 userland.
evbarm64-el
This is clang only.  While gcc4.8 supports aarch64, no netbsd support has
been written for aarch64 with gcc4.8.
2014-08-10 05:56:36 +00:00
matt beb9c6d1b5 Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
2014-08-10 05:47:35 +00:00
joerg 3d95c8af33 Fix braino in last commit and free the node iff the insert failed. 2014-07-20 14:40:58 +00:00
lneto 4ab4902eb2 lua: updated from 5.1 to 5.3 work3
* lua(1):
  - changed lua_Integer to intmax_t
  - updated distrib/sets/lists and etc/mtree
  - updated bsd.lua.mk
  - fixed bozohttpd (lua-bozo.c)
  - compatibilized bindings: gpio, sqlite
* lua(4):
  - removed floating-point and libc dependencies using '#ifndef _KERNEL'
  - fixed division by zero and exponentiation
  - libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
  - acpica: removed isprint() from acnetbsd.h
  - libc: moved strcspn.c, strpbrk.c and strspn.c to common
  - removed stub headers
  - compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE
2014-07-19 18:38:33 +00:00
joerg 827ab89a76 Use static_cast for rb_tree_insert_node void * return value. 2014-07-14 11:36:39 +00:00
jmcneill 65c6ea680a ${.PARSEDIR} not .${PARSEDIR} for Makefile.compiler-rt include 2014-07-04 16:44:26 +00:00
joerg 1aed1443e6 IAS is clang specific. 2014-06-30 20:42:31 +00:00
joerg 182cb3ee17 .fpu is not handled correctly by LLVM's assembler parser, so use GAS for
now.
2014-06-28 20:18:15 +00:00
rtr e9c95bf579 patch posted to tech-kern@ 2014/06/25 for review with minor changes
resulting from feedback.

move multiple copies of code for parsing boot.cfg file from sparc, i386
and zaurus into libsa/bootcfg.{h,c}. largely retained i386 parsing logic
in addition to keeping sparc dispatch function while remaining consistent
with boot.cfg(5).

previous sparc64 file format has been obsoleted but only used by boot
CDs distrib/sparc64/bootfs/boot.cfg has been updated to compensate.

exported names have been prefixed with either BOOTCFG_ or bootcfg_ as per
feedback from christos@

tested on amd64 & sparc64 but not zaurus.
2014-06-28 09:16:18 +00:00
mrg ac641cb906 remove remaining makefile support for GCC < 45 that i found. 2014-06-14 20:49:36 +00:00
matt a50cc6d607 Split COPTS.libunwind.cxx into multiple lines. 2014-06-13 21:31:20 +00:00
mrg 26f35dd6b6 remove the build support for GCC 4.1, and any hacks i found for it.
there could still be more -- i only looked for lines matching
both "HAVE_GCC" and "4" as words (grep -w.)
2014-06-13 01:17:45 +00:00
joerg 0ed4c83ba9 Lazy VFP processing works a lot better if the functions contain a return
instruction.
2014-05-14 22:13:36 +00:00
joerg 2f1b7695c4 Support DWARFish unwind for ARM. 2014-05-11 02:07:35 +00:00
joerg 7e3335542c Missing register validation check. 2014-05-03 23:19:56 +00:00
jakllsch 849344e6ee Makefile glue to build libgnuefi; similar to libsa or libkern. 2014-04-28 19:09:29 +00:00
joerg 0c55f87954 GC unwind_info_size. 2014-04-28 13:39:23 +00:00
joerg d013f698cc Use the return address register from the CIE. Based on patch from Nick
Kledzik.
2014-04-26 23:17:38 +00:00
joerg 380ce570fd Add initial unwind support for MIPS and MIPS64. 2014-04-26 20:15:48 +00:00
joerg f76ae5ef4f Basic unwind support for HPPA. 2014-04-19 21:21:24 +00:00
joerg a997683cbb Add basic Alpha support to libunwind. 2014-04-15 18:40:34 +00:00
joerg 7209984597 Add initial unwind support for SPARC/SPARC64. 2014-04-15 11:44:26 +00:00
joerg 4b91d83710 Some architectures like SPARC need to apply a fixed offset to the return
address. Introduce such a constant.
2014-04-14 18:15:17 +00:00
joerg 44e617ea85 Move definition of what the native register layout is into
Registers.hpp.
2014-04-13 19:04:01 +00:00
joerg 8886a873b8 Support SH3 in our unwinder. 2014-04-02 22:34:29 +00:00
joerg 8d85521c7b SH3 uses unaligned data in the .eh_frame section, so use memcpy. 2014-04-02 22:22:37 +00:00
jakllsch edd6a404ba Obtain and/or use ETHER_ADDR_LEN. 2014-03-29 14:30:16 +00:00
jakllsch 836038fc64 Use ETHER_ADDR_LEN more. 2014-03-29 14:25:10 +00:00
jakllsch 2f39df062c Obtain and use ETHER_ADDR_LEN where appropriate.
Drop unnecessary includes.

XXX libsa ether_sprintf() should maybe be ether_snprintf.
2014-03-29 14:20:14 +00:00
christos 54ec44dad1 Remove {v,}sprintf 2014-03-26 18:02:24 +00:00
joerg dd0e21086c Save & restore FP registers. 2014-03-25 00:00:55 +00:00
joerg 0378fc4757 Add m68k support to our unwinder. 2014-03-24 21:25:03 +00:00
hkenken 0f26c1cc74 for LIBSA_PRINTF_WIDTH_SUPPORT,
Fix right and left-adjusting padding.
2014-03-22 02:51:44 +00:00
christos c1ae06abab kill sprintf 2014-03-20 20:42:08 +00:00
christos 3946297f1a new header. 2014-03-20 03:13:31 +00:00
christos 303a695e1b reduce size by 1K by sharing the ls code. 2014-03-20 03:13:18 +00:00
joerg 1fad0e91e1 Fix DW_CFA_GNU_args_size handling. The primary architecture using this
opcode is VAX. A function call pushes the number of arguments given onto
the stack and "ret" will pop it automatically. The FDE of the caller
contains the amount of stack space used for arguments (and possibly
extra padding), so unwinding has to compensate for this when "returning"
from a function. This is exactly the case when step() is done. The
existing handling in _Unwind_SetIP no longer makes sense.
2014-03-20 01:35:45 +00:00
joerg 9a7eb6d5aa Drop XXX, spell R14 as SP. 2014-03-19 21:15:45 +00:00
joerg 0498752769 Allow building with GCC 4.1 by providing <cstdint> 2014-03-19 16:46:23 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
joerg c9aa4ad46c Add basic unwind support for VAX. PSW handling and stack pointer after
resume is still incomplete.
2014-03-18 13:08:15 +00:00
pooka bb154207c8 remove compiler-rt duplicates to fix build 2014-03-13 16:09:11 +00:00
joerg a5e04a5e0f Kill one colon that shouldn't be. 2014-03-13 01:50:50 +00:00
joerg 0f0483b305 libstdc++ doesn't like me using <cstdint> without requesting C++11, so
just do so.
2014-03-13 00:56:41 +00:00
joerg d952896fa0 Add _Unwind_GetIPInfo for libstdc++. 2014-03-13 00:28:20 +00:00
joerg a0318c3f0f Pass down data_base just in case something actually tries to use it. 2014-03-12 22:50:59 +00:00
joerg a6d7909bce Add more const to make GCC happy. 2014-03-12 15:31:55 +00:00
pooka 1ee7f81f1b Do not include compiler-rt in librump. librump is not a toolchain support
library, and toolchain support belongs in the host libc or libgcc or
equivalent entity that is actually supposed to complement the toolchain.

Fixes librump build on (a) Linux ARM (collisions with libgcc)
2014-03-12 00:22:53 +00:00
joerg b77db904fb Add a dummy element as explicit padding for PPC32. Fix DWARF enumeration
to match the values created by GCC. Fix DWARFish -> index conversion.
2014-03-12 00:01:12 +00:00
joerg fb33a5654b Rename IP_PSEUDO_REG to RETURN_REG. Fix PPC value. Sort. 2014-03-11 23:57:42 +00:00
joerg 1b4a81d6d1 GC unused enum. 2014-03-11 23:55:11 +00:00
joerg 499c31d6cd 0 is a valid LSDA encoding and can be seen in statically linked
programs. Initialize lsdaEncoding to DW_EH_PE_omit and check for that
value to decide whether a value should be decoded.
2014-03-11 23:52:17 +00:00
nakayama 1b088eaae2 Align explicitly to make kernels compiled by clang generate
properly aligned code.
2014-03-07 20:23:09 +00:00
joerg 2ce54a14d1 Provide labs, llabs and imaxabs for kernel use. 2014-02-27 18:05:07 +00:00
joerg a48c968746 Update compiler-rt glue for the new source layout. 2014-02-26 22:37:55 +00:00
joerg 685add8053 Casting to void is the canonical way of marking a variable as
potentially unused.
2014-02-20 00:29:03 +00:00
njoly 9d9871abbe Revert previous revision. It bkeaks profiling kernel builds.
LIBISPRIVATE unconditionnally set MKPROFILE to no, preventing
profiling kernel library.
2014-02-09 12:53:30 +00:00
joerg 720b2586bd Include compiler-rt in libc, libm and libkern. 2014-01-29 23:37:18 +00:00
joerg 9de82816fc For ARM EABI, includ divide-by-0 trap handlers. 2014-01-29 22:30:24 +00:00
matt a11fbefc31 Add support for non-EABI (DWARF) ARM exception handling. 2014-01-29 06:59:53 +00:00
joerg 329758262f This is not libc, so don't check the libc arch macro. 2014-01-17 00:49:55 +00:00
joerg 7a05a6aa88 For HAVE_LIBGCC=no, use compiler-rt for quad support. 2014-01-15 21:12:57 +00:00
tsutsui bb834b97ba Remove obsolete exec.c for a.out. It was superseded by loadfile() long ago. 2014-01-12 15:19:57 +00:00
jakllsch d2ad8298ea Make libsa fsmod string pointer const. 2014-01-05 21:38:25 +00:00
christos 5e0bd251ff add strncat (for acpi) 2013-12-27 20:25:33 +00:00
jakllsch cc6c3a11f9 intmax_t might be long long, handle accordingly. from christos 2013-12-24 22:26:21 +00:00
jakllsch 74f35cdadc Add 'j' format modifier for intmax_t. 2013-12-24 21:41:49 +00:00
joerg a060b1754e Fix typo. 2013-12-20 12:46:42 +00:00
pooka e546a6c273 Allow overriding CTASSERT. This helps with building NetBSD sources with
compilers that don't support __COUNTER__ -- shifting the CTASSERTs
around to avoid __LINE__ conflicts is a hopeless struggle.
2013-12-15 21:15:41 +00:00
joerg aceb213538 Allow kernel code to access constant databases by moving cdbr(3) and the
required mi_vector_hash(3) into src/common.
2013-12-11 01:24:08 +00:00
joerg ab0f68f9e6 libkern build glue for compiler-rt. 2013-12-03 16:15:22 +00:00
lneto c4a02e0a12 changed lua_Number to int64_t 2013-12-02 04:39:10 +00:00