Commit Graph

281893 Commits

Author SHA1 Message Date
christos
ba78da4b48 Handle the no-addr-of-packed-member only for the files that need it, not
globally.
2020-10-18 19:57:44 +00:00
christos
0f75d4c102 Provide a global no-packed-address for both gcc and clang 2020-10-18 19:56:41 +00:00
rillig
587ff3c418 make(1): fix GCC warning about small buffer for cohort_num
Since unmade_cohorts is a signed number (the code contains an underflow
check), the result of the '%' operator could be negative and result in
"#-999999", which would overflow the buffer, truncating the last digit.
2020-10-18 19:11:35 +00:00
chs
31e69e6c91 In the current code, CPU_COUNT_FREEPAGES counts pages in the global
freelists AND the per-CPU pgflcache free pages caches, and that is the
number of pages that the pagedaemon considers to be available.
However, most pages in the pgflcache per-CPU free page caches are NOT
actually available for any particular allocation, and thus allocating
a page can fail even though the pagedaemon thinks enough pages are
available.  This change makes CPU_COUNT_FREEPAGES only count pages in
the global freelists and not pages in the pgflcache per-CPU free page
caches, thus better aligning the pagedaemon's view of how many pages
are available with the number of pages that can actually be allocated
by any particular request.  This fixes a hang that Christos was hitting.
2020-10-18 18:31:31 +00:00
chs
9d18193c79 Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to
uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to
handle this flag separately.  Split out the pages part of uvm_aio_aiodone()
into uvm_aio_aiodone_pages() in rump just like in the real kernel.
In ZFS functions that can fail to copy data between the ARC and VM pages,
use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can
handle these "I/O" errors.  Fixes PR 55702.
2020-10-18 18:22:29 +00:00
rillig
428a4a93f2 make(1): switch some tests to line-buffered stdout
On Alpine Linux, the output was not in the same order as on NetBSD,
at least since bmake-20200902.

The mixture of block-buffered output from child processes and make
itself was hard to predict anyway.  Switching to line-buffered stdout
improves the stability of the tests.
2020-10-18 18:12:42 +00:00
tnn
b17f0570cb efiboot: bump version 2020-10-18 18:09:32 +00:00
tnn
33908812c2 efiboot: recognize the EFI system partition as fstype MSDOS 2020-10-18 18:05:48 +00:00
rillig
1834930409 make(1): extract duplicate code from SuffAddSrc into separate function 2020-10-18 17:41:06 +00:00
rillig
2e62f9c853 make(1): add tags to enum types
This allows IDEs to offer better type information than "anonymous enum".
2020-10-18 17:19:54 +00:00
rillig
6cb2acfc10 make(1): improve parameter names for suffix functions
Both gs_gnp and gnp were terrible variable names that didn't give the
slightest clue about the variable's purpose.
2020-10-18 17:12:43 +00:00
rillig
fbbd721728 make(1): extract UpdateTargets from Suff_AddSuffix 2020-10-18 17:06:14 +00:00
rillig
4318de728d make(1): inline struct SuffScanTargetsArgs into SuffScanTargets 2020-10-18 17:00:22 +00:00
rillig
7fb19ed146 make(1): add test for turning a target into a transformation 2020-10-18 16:33:18 +00:00
skrll
77314eed7d Trailing whitespace 2020-10-18 16:28:57 +00:00
rillig
0be063820a make(1): fix typo in test suff-rebuild.mk 2020-10-18 16:12:39 +00:00
rillig
45d402da38 make(1): rename struct GNodeSuff to SuffScanTargetsArgs 2020-10-18 16:01:44 +00:00
rillig
ea17a7f466 make(1): inline struct LstSrc into SuffAddSrc
The variable names are still confusing.  There was no useful
documentation on the struct, and the code in SuffAddSrc is highly
redundant.  Maybe the next few refactorings will shed light on this part
of the code.
2020-10-18 15:53:47 +00:00
rillig
44a0e7b168 make(1): remove void pointers from SuffAddSrc 2020-10-18 15:40:54 +00:00
rillig
ba76635dfe make(1): replace Lst_Open with simple iteration in SuffInsert 2020-10-18 15:31:43 +00:00
christos
00a4973a0c include <bsd.own.mk> where missing. 2020-10-18 15:20:13 +00:00
christos
facf2dbee5 use the GCC_ warning variable 2020-10-18 15:02:12 +00:00
rillig
30bc76235e make(1): replace Lst_Open with simple iteration in Make_HandleUse 2020-10-18 14:58:45 +00:00
christos
912321b7f4 Avoid alignment of packed member 2020-10-18 14:36:43 +00:00
rillig
e769b7497f make(1): replace Lst_Open with simple iteration in Dir_SetPATH 2020-10-18 14:36:09 +00:00
christos
53f398bf72 Avoid alignment of packed member 2020-10-18 14:33:28 +00:00
rillig
56ae3bf01a make(1): replace Lst_Open with simple iteration in Dir_FindFile 2020-10-18 14:32:04 +00:00
rillig
81d39425db make(1): replace Lst_Open in Suff_DoPaths with simple iteration
Since sufflist is not modified during iteration, there is no need for
the extra complexity of Lst_Open.
2020-10-18 14:09:39 +00:00
jmcneill
0834f1233a Treat ARGB/XRGB as BGRA/BGRX on big endian kernels. 2020-10-18 14:00:08 +00:00
gson
a59360497a Suppress the "rn_init: radix functions require max_keylen be set"
message when _KERNEL is defined, to avoid spurious messages from
kernels that have no routable network domains.  Fixes PR kern/55691.
2020-10-18 13:07:31 +00:00
rillig
92688ee547 make(1): rename Lst_Init to Lst_New
For the other types such as HashTable and Buffer, the Init function does
not allocate the memory for the structure itself, it only fills it.
2020-10-18 13:02:10 +00:00
rillig
fb73d14d90 make(1): rename HashEntry.name to key 2020-10-18 12:47:43 +00:00
rin
dd0005a97a Revert rev 1.75; do not set WSFB_VRAM_IS_RAM flag bit. It indicates
memory type obtained by mmap. I just misunderstood its intention.

Thanks to jmcneill for pointing it out!
2020-10-18 12:47:37 +00:00
rillig
5a07777488 make(1): remove underscore from Hash_Table and Hash_Entry
For consistency with the other type names, such as GNodeListNode.
2020-10-18 12:36:43 +00:00
rillig
fed8931567 make(1): migrate ArchFree from Hash_Search to HashIter 2020-10-18 12:00:16 +00:00
rin
1075672ff1 Remove stray TABs. No binary changes. 2020-10-18 12:00:12 +00:00
rillig
5658125d0a make(1): prepare for WARNS=6
The FD_* macros from sys/sys/fd_set.h use signed integers on NetBSD 8
and thus produce conversion errors.  On NetBSD 9, these macros are fixed
to use 1U instead of 1.
2020-10-18 11:54:43 +00:00
rin
7a801774a0 For WSDISPLAYIO_GET_FBINFO ioctl, set WSFB_VRAM_IS_RAM to fbi_flags
when shadow FB is used.
2020-10-18 11:54:20 +00:00
rin
4d3ccdb20f Fix undefined behaviors found by kUBSan.
Tested on VirtualBox with amd64 kernel.
2020-10-18 11:51:08 +00:00
rillig
78449cb4c7 make(1): use consistent include guard for headers 2020-10-18 11:49:47 +00:00
rillig
7338f5c063 make(1): convert NoExecute to non-inline
The header make.h is not only used by usr.bin/make but also by
usr.bin/xinstall, to get the needshell function.

That program does not declare the variables noRecursiveExecute and
noExecute, leading to an "unresolved reference" at link time.  To fix
this, move the inline functions away from make.h.

It's a quirk that make.h gets included by other programs since it
contains a whole lot of definitions that are only useful in make itself.
If any, there should be a separate header that defines the public
library API of make, and only that.
2020-10-18 11:09:08 +00:00
mlelstv
5c685f7b3c Make command line arguments -r and -w actually override defaults from fstab,
previously -w would only cancel a preceeding -r.

No longer strip -o rw.
2020-10-18 10:57:30 +00:00
rillig
363a9449ba make(1): make API for iterating over hash tables simpler 2020-10-18 10:44:25 +00:00
leot
12d649ab88 Add PBR and VBR
From Rocky Hotas, thanks!
2020-10-18 10:17:09 +00:00
rin
1cdc8960cb Fix build for mips; move from mi to module.mi debug symbols for
test cases only available when MKKMOD=yes.
2020-10-18 10:10:18 +00:00
rillig
09fc919e11 make(1): rename Stack to Vector
Both Var_Dump and GetActuallyIncludingFile access more than only the top
item of the stack, therefore it is more honest to rename the data type.
2020-10-18 08:58:29 +00:00
rin
27b5f91738 PR kern/55658
Revert rev 1.122:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/uvm/uvm_bio.c#rev1.122

If this commit is applied to NFS client, changes to files in client
side are sometimes invisible in server side, which results in file
corruption.

Demonstrated by test code provided by Anthony Mallet:
https://mail-index.netbsd.org/current-users/2020/10/17/msg039708.html

Whether the test case above passes or not depends on architectures
and size of NFS I/O specified by -r and -w options of mount_nfs(8)
(the default size is 32KB for x86 and 8KB for other archs).

Whereas it fails on amd64 and i386 with the default size, it passes
on other archs (aarch64, arm, alpha, m68k, and powerpc at least) with
their default. On most ports, it fails with some I/O sizes.

However, the condition for failure is still unclear; whereas it fails
with 2KB I/O size on amiga (m68k, 8KB page), it passes with same I/O
size on alpha (8KB page). It may depends on some VM parameters or
details in pmap implementation, or some race conditions are involved.

Great thanks to Anthony Mallet for providing the test code, and sorry
everyone for breakage.
2020-10-18 08:52:15 +00:00
rillig
e529ac9d3e make(1): sort variables in debug output
This way it's easier to see whether an expected variable is missing, or
to compare the values of related variables, since they usually share a
common prefix.  Any sorting criterion is better than the hash code.

Sorting the variables by name changed the order of the output in
varname.mk.  That test didn't test anything meaningful, it was just a
playground to understand and demonstrate the current implementation of
how the variables are stored, therefore it has been removed.
2020-10-18 08:47:54 +00:00
rillig
a4f978df6c make(1): extract GNode_OpName from Targ_PrintNode 2020-10-18 08:24:01 +00:00
rillig
687be6e519 make(1): remove USE_IOVEC
When a system call in a child process failed, there was no guarantee
that the error message would be written completely.  Using writev
correctly is harder than building the string in a buffer and then
writing it in the traditional way.

According to POSIX 2004, using memory allocation or even calling
write(2) from the child process invokes undefined behavior.  The
remaining code from make has done all this for several years now,
successfully, therefore adding one more of that won't hurt.

Make still tries to write the error message atomically by passing the
whole buffer at once to write(2), just as in the previous writev(2)
implementation.
2020-10-18 08:01:23 +00:00