Commit Graph

1727 Commits

Author SHA1 Message Date
rin 701cc34a36 netif_open: Fail with ENXIO instead of panic if no netif available
Avoid undesirable freeze for efiboot/x86 when interfaces are really
unavailable, or fail to be configured by buggy UEFI firmware.
2023-09-14 03:08:31 +00:00
mrg 41aabe1d7a fix the example for container_of().
needs to be a pointer into the containing structure, not the
value of a pointer inside the structure.
2023-09-06 19:14:52 +00:00
christos 3abf085826 explicitly pass COPTS 2023-08-30 18:47:56 +00:00
christos f7259cc386 We don't want SSP/FORTIFY here. 2023-08-30 18:47:37 +00:00
rin 1dbc3f1d79 libunwind: Drop unused/wrong reg_t typedef for alpha 2023-08-23 10:40:10 +00:00
mrg 6ed8189e16 avoid uninitialised variable warnings (likely incorrect ones.)
cry wolved by GCC 12.
2023-08-11 07:05:39 +00:00
rin 744263e3e0 Add /* FALLTHROUGH */ comment for sure. 2023-06-14 00:28:55 +00:00
rin 9bacf14f2a libsa/printf: Do not fetch long va_arg as long long.
This does real harm iff all of the following conditions are satisfied:

(1) On ILP32 architectures.
(2) Both LIBSA_PRINTF_LONGLONG_SUPPORT and LIBSA_PRINTF_WIDTH_SUPPORT
    compile-time options are enabled.
(3) Width field is used with 'l' modifier.

This is an implicit-fallthrough bug, but unfortunately, GCC 10.4 cannot
find this out somehow...

XXX
Pull up to netbsd-10 and netbsd-9. netbsd-8 is not affected.
2023-05-29 03:56:52 +00:00
christos dc43f412b0 fix clang build 2022-12-01 18:06:09 +00:00
chs 87ba0e2a31 Restore backward compatibility of UFS2 with previous NetBSD releases by
disabling support in UFS2 for extended attributes (including ACLs).
Add a new variant of UFS2 called "UFS2ea" that does support extended attributes.
Add new	fsck_ffs operations "-c	ea" and	"-c no-ea" to convert file systems
from UFS2 to UFS2ea and	vice-versa (both of which delete all existing extended
attributes in the process).
2022-11-17 06:40:38 +00:00
rin eec9572cb1 Consistently use ntohs() instead of htons() when converting from
network to host byte order.

No binary changes both for big and little endian.
2022-08-07 05:51:55 +00:00
skrll afda606fbe alredy -> already 2022-07-08 07:02:47 +00:00
martin 8f08765306 Fix editing mishap, should fix the build 2022-06-27 06:45:14 +00:00
skrll d8ce3d4857 Teach the LLVM-derived unwinder about the DWARF pseudo-registers defined
by GCC for HPPA to hold the return address where the signal trampoline
will resume.  XXX Same treatment is needed for HPPA64, but not done as
part of this commit.

Thanks to thorpej for help with this. (ages ago)
2022-06-26 14:31:33 +00:00
rillig 2a9be2a76b libkern: fix wrong escaping in makefile
In the unlikely event that KERNDIR contains a '$' character, that '$'
should not be doubled to '$$'. It only needs the usual shell quoting.
2022-06-19 18:28:16 +00:00
skrll 8c5aad32f0 Fix a dumb typo/thinko
Thanks to Tom Lane for spotting it.
2022-06-15 21:31:19 +00:00
skrll 934c436b1e Provide a __canonicalize_funcptr_for_compare which only needs to return
the passed value as the kernel doesn't do PLABELS.

PR/56878 (hppa: kernel module lua fails to load)
2022-06-13 16:03:07 +00:00
skrll 8ad5b80d68 Don't need $$sh_func_adrs 2022-06-13 16:00:05 +00:00
rin 9261ab392b Restrict strictly-aligned versions of memcmp(9), memcpy(9), and
memmove(9) to 403, instead of all evbppc machines.

Introduce strict-align LIBKERN_MD_FLAGS for this purpose.
2022-05-30 14:18:10 +00:00
rin 031d59ff12 Introduce LIBKERN_MD_FLAGS to pass some MD flags for libkern.
This is necessary since libkern is built by coprocess, and
threfore subsets of make(1) variables are passed.
2022-05-30 14:13:59 +00:00
rin 2786ceb6bd Now, NULL is always defined correctly, as we include <sys/param.h> above. 2022-04-30 09:24:05 +00:00
rin 04dc166927 Re-introduce SA_HARDCODED_SECSIZE hack, by which hardcoded DEV_BSIZE is
used instead of secsize obtained by SAIOSECSIZE ioctl.

This hack avoids divdi3 and friends from being linked, in order to
support variable secsize for some archs.

Should be useful for ancient archs, for which secsize is fixed.

Thanks christos@ for comment.
2022-04-29 07:42:07 +00:00
rin 7ca4ea5592 Revert previous at the moment.
This is wrong reasoning; 68020 and above (incl. 040 and 060) support
32-bit displacements for PC relative addressing (via "fully extension
addressing mode" with null index register).

I've still not figured out what goes wrong with amiga/boot(8) when
compiled without -l option for gas(1)...

On 2022/04/27 20:48, Rin Okuyama wrote:
> Module Name:	src
> Committed By:	rin
> Date:		Wed Apr 27 11:48:26 UTC 2022
>
> Modified Files:
> 	src/sys/lib/libsa: ext2fs.c minixfs3.c stand.h ufs.c
>
> Log Message:
> Introduce SA_HARDCODED_SECSIZE hack, by which hardcoded DEV_BSIZE is
> used instead of secsize obtained by SAIOSECSIZE ioctl.
>
> This hack avoids divdi3 and friends from being linked, in order to
> support variable secsize.
>
> This is useful for amiga/boot(8); it is loaded by firmware into
> unpredictable address, and therefore all symbols should be
> addressable by PC relative mode with only 16-bit displacements.
>
> See sys/arch/amiga/stand/bootblock/{boot/bbstart.s,elf2bb,txlt} for
> more details.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.31 -r1.32 src/sys/lib/libsa/ext2fs.c
> cvs rdiff -u -r1.10 -r1.11 src/sys/lib/libsa/minixfs3.c
> cvs rdiff -u -r1.83 -r1.84 src/sys/lib/libsa/stand.h src/sys/lib/libsa/ufs.c
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
2022-04-27 14:48:50 +00:00
rin e11b3c29a6 Introduce SA_HARDCODED_SECSIZE hack, by which hardcoded DEV_BSIZE is
used instead of secsize obtained by SAIOSECSIZE ioctl.

This hack avoids divdi3 and friends from being linked, in order to
support variable secsize.

This is useful for amiga/boot(8); it is loaded by firmware into
unpredictable address, and therefore all symbols should be
addressable by PC relative mode with only 16-bit displacements.

See sys/arch/amiga/stand/bootblock/{boot/bbstart.s,elf2bb,txlt} for
more details.
2022-04-27 11:48:26 +00:00
mlelstv 56b23fbb85 Don't load filessytem module for filesystem that was found but isn't used
for booting.
2022-04-24 06:52:59 +00:00
mlelstv 5290066ee5 Ask driver about sector size to support reading superblocks from fixed
byte offsets.
2022-04-24 06:48:15 +00:00
skrll a60573591b Typo in comment. avoinds -> avoids 2022-04-19 09:25:38 +00:00
andvar 62e7294679 fix typos, mainly s/comand/command/ 2022-01-05 16:01:54 +00:00
riastradh 57efa05d59 libkern: Make KASSERT verify expression is valid if !DIAGNOSTIC.
This way it is no longer necessary to mark variables __diagused if
they are used in KASSERT conditions.

Fix fallout from this by removing now-unnecessary and `#ifdef
DIAGNOSTIC'.

Don't do the same for KDASSERT if !DEBUG -- unlike KASSERT and
DIAGNOSTIC, variables needed by KDASSERT and DEBUG are likely to be
expensive to compute (and potentially difficult for a compiler to
prove flushable), so we don't want to require them under !DEBUG.
2021-12-31 14:19:57 +00:00
chs 3bb0445a32 revert rev 1.4 ("Add garbage instructions at end of kern_assert after vpanic.")
that change had no effect because vpanic() is marked __dead / noreturn
and thus the compiler would optimize away everything after a call to vpanic().
the original problem has now been fixed differently (but only for x86 so far).
2021-12-13 01:33:32 +00:00
thorpej d7b75e6eaa Teach the LLVM-derived unwinder about the DWARF pseudo-registers defined
by GCC for SuperH for GBR, MACH, MACL, and SR.
2021-11-24 00:21:59 +00:00
thorpej 3c9111595d Revert unintended commit. 2021-11-22 16:41:32 +00:00
thorpej 4ee192103f Gah, fix two typos. 2021-11-22 16:41:00 +00:00
thorpej 241ca3464c Teach the LLVM-derived unwinder about the DWARF pseudo-register defined
by GCC for AArch64 to hold the return address where the signal trampoline
will resume.
2021-11-22 16:40:01 +00:00
thorpej a2dfa8a4c3 Teach the LLVM-derived unwinder about the alternate DWARF pseudo-register
that GCC defines for the PC / return address.  This is simply an alias for
the same internal PC register number.
2021-11-21 23:34:44 +00:00
thorpej 2944d33d0c Teach the LLVM-derived unwinder about the DWARF pseudo-register defined
by GCC for PPC32 to hold the return address where the signal trampoline
will resume, as well as for the CTR and XER registers.
2021-11-21 21:15:17 +00:00
skrll d7a401a8a2 Add parentheses 2021-11-21 10:53:01 +00:00
thorpej 834c26d8b1 Teach the LLVM-derived unwinder about the DWARF pseudo-register defined
by GCC for Alpha to hold the return address where the signal trampoline
will resume.
2021-11-20 19:06:21 +00:00
thorpej 9d3f86a921 - Teach the LLVM-derived unwinder about the DWARF pseudo-registers defined
by GCC for MIPS64 to hold the MDHI and MDLO registers, as well as the return
  address where the signal trampoline will resume.
- In the MIPS64 validFloatVectorRegister(), compare against the internal
  register numbers, not the DWARF register numbers.
2021-11-20 18:19:18 +00:00
thorpej ec28cc6b78 - Teach the LLVM-derived unwinder about the DWARF pseudo-registers defined
by GCC for MIPS to hold the MDHI and MDLO registers, as well as the return
  address where the signal trampoline will resume.  XXX Same treatment is
  needed for MIPS64, but not done as part of this commit.
- In the MIPS validFloatVectorRegister(), compare against the internal
  register numbers, not the DWARF register numbers.
2021-11-18 04:20:11 +00:00
ryo f989f9625c revert previous: http://mail-index.netbsd.org/source-changes/2021/10/25/msg133295.html
going to add __always_inline to the functions called from _mcount()
discussed on http://mail-index.netbsd.org/source-changes-d/2021/10/25/msg013480.html
2021-10-27 03:06:59 +00:00
ryo 843ce00650 In some arch, _mcount() would be called recursively when built with COPTS=-O0.
Normally, functions called from mcount.c are expected to be expanded inline,
so _mcount() will never be called recursively. But when build with COPTS=-O0,
`static inline' functions aren't inlined, and _mcount() will be called
recursively.

Even if _mcount() has `__attribute__((__no_ instrument_function__))',
it has no effect on the calling external (no-inlined) function.

To avoid this, PROF.<fn> is added can be set the profiling flag of any file.
"PROF.mcount.c" is set to blank by default, mcount.c itself is compiled
without -pg.
2021-10-25 07:54:44 +00:00
jmcneill e63dca36f8 Only define DEFAULT_TIMEOUT if it is not already defined. 2021-10-17 14:12:21 +00:00
nia b7fed38c88 Remove banner printing code from bootloaders, add it to libsa.
This harmonizes efiboot and the various x86 bootloaders to use shared
code for printing the banner. By friendly coincidence, it also adds
support for specifying 'banner=' in arm efiboot's boot.cfg, as on x86.
2021-09-07 11:41:31 +00:00
andvar 2e0bf311b3 fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected. 2021-08-17 22:00:26 +00:00
andvar 272cac88dd s/aligment/alignment/ + one more typo fix in comments. 2021-08-09 21:08:06 +00:00
andvar d7fca1ab3d fix typos in asymmetry, asymmetric(al), symmetrical. 2021-08-09 19:57:57 +00:00
rin 76020b2c7d Improve previous:
- Add suffix ``d'' for mkdep(1).
- Improve comment a little...
2021-07-26 12:49:13 +00:00
rin 735b96eca6 For evbppc, use C version of memcpy(3), memcmp(3), and memmove(3)
consistently for *.{po,pico,go} (for RUMP), in order to avoid
alignment faults for 403.
2021-07-24 05:29:26 +00:00
rin 749cec1f31 PR port-arm/55897
Fix ABI mismatch for armhf runtime routines for floating-point arithmetics;
For hard-float arm variants, provide

(1) generic runtime routines with correct calling convention, and
(2) EABI runtime routines at the same time.

I've confirmed that no binary changes for kernels.

LGTM by skrll
2021-06-16 05:21:08 +00:00