Commit Graph

281237 Commits

Author SHA1 Message Date
roy
4b44dc0b5e vether: Implement a virtual ethernet interface
The vether interface simulates a normal Ethernet interface by encapsulating
standard network frames with an Ethernet header, specifically for use as
a member in a bridge(4).

To use vether the administrator needs to configure an address onto the
interface so that packets can be routed to it. An Ethernet header will
be prepended and, if the vether interface is a member of a bridge(4),
the frame will show up there.

Taken from OpenBSD.
2020-09-27 13:31:04 +00:00
rillig
60d7c828b9 make(1): inline Lst_ForEachUntil in Make_ExpandUse
The tricky detail here is that the current node from the iteration is
removed if it is no longer needed.

The Lst_FindDatum that has been removed was both inefficient and
misleading since it could never return null, yet there was a null check
for it.  The callback API from Lst_ForEachUntil would have required to
define a custom struct for passing this parameter to the callback
function, in addition to the parent node.

Inlining the whole Lst_ForEach and passing the list node as a parameter
is much more obvious.
2020-09-27 13:27:50 +00:00
rillig
234523181b make(1): run tests with jemalloc debugging enabled
This protects against very simple memory allocation bugs such as
migrating Lst_ForEachUntil to Lst_ForEach without remembering that
Lst_ForEachUntil can handle the situation where the current list node is
removed from the list, but Lst_ForEach cannot.  This happens in
Make_ExpandUse, for example.
2020-09-27 13:18:30 +00:00
rillig
bd99e52e66 make(1): inline Lst_ForEachUntil when parsing dependency lines
This avoids a few operations on void pointers.
2020-09-27 12:42:09 +00:00
rillig
fbb9ffc12c make(1): remove redundant null checks for the active targets
Before August 2020, the Lst library passed null pointers through.  This
was a confusing design pattern that has been removed since.  Now the Lst
functions fail fast on null pointers.

The 'targets' list is one of the few places where there is indeed an
optional list that may sometimes be null.  Back then, there was not
enough inline documentation to understand when the targets list was null
and when it wasn't.

Now that the documentation is there, the redundant and thereby
misleading null checks are no longer useful.
2020-09-27 12:26:23 +00:00
rillig
8cbf8c1227 make(1): inline PrintNode
Having a separate function had only been necessary for Lst_ForEachUntil.
2020-09-27 12:10:51 +00:00
rillig
8a70bc7074 make(1): inline Lst_ForEachUntil in ParseDoDependency 2020-09-27 12:05:04 +00:00
jmcneill
f97971ac12 Use HAVE_NVMM for nvmm headers 2020-09-27 11:57:28 +00:00
rillig
8f714173e8 make(1): inline Lst_ForEachUntil in Targ_PrintNodes
Printing a node does not modify the structure of the node, therefore the
additional housekeeping of Lst_ForEachUntil is not needed here.

Inlining the callback function also removes a lot of pointer stuff that
is more difficult to read than necessary.
2020-09-27 11:53:03 +00:00
rillig
405c56c525 make(1): inline Lst_ForEachUntil in Compat_Make
This avoids the extra local function and a few conversions to void
pointers, to gain additional type safety.

The code in Compat_RunCommand does not modify gn->commands structurally,
therefore it does not need the extra complexity of Lst_ForEachUntil.  It
does have access to a list node to exactly this list.  This list node is
only used to set the command to NULL after processing it, not for
removing the node from the list.
2020-09-27 11:43:46 +00:00
rillig
f393c9dcac make(1): rename local variable in MakeNodes
By convention, list nodes are named ln to distinguish them from GNodes,
which are called gn.
2020-09-27 11:39:02 +00:00
rillig
bdbb6e0ce2 make(1): make parameter of Compat_RunCommand const 2020-09-27 11:37:19 +00:00
rillig
1430a31b22 make(1): clean up comments in job.c and make.c 2020-09-27 11:14:03 +00:00
mrg
4bebf00e7f only look for cpunode.h on OCTEON. that's the only direct
caller of *_kern_nonmaskable_intr().
2020-09-27 10:35:57 +00:00
rillig
4ae53a3e65 make(1): fix CRLF line endings in unit tests 2020-09-27 09:53:41 +00:00
mrg
fd2e38eaf1 fix usr.bin/make build (which uses more warnings):
remove static only prototype TargPrintOnlySrc().
PrintOnlySources() does not return a value, make it void.
2020-09-27 01:07:12 +00:00
roy
13422f008b rump: Add weak alias for bridge_calc_link_state 2020-09-27 00:34:44 +00:00
mrg
a5281379e4 note GMP 6.2.0 is in -current. 2020-09-27 00:32:22 +00:00
roy
1f76477386 bridge: Calculate link state as the best link state of any member
If any member is LINK_STATE_UP then it's LINK_STATE_UP.
Otherwise if any member is LINK_STATE_UNKNOWN then it's LINK_STATE_UNKNOWN.
Otherwise it's LINK_STATE_DOWN.
2020-09-27 00:32:17 +00:00
mrg
bc89ad3318 mknative-gmp output for GMP 6.2.0. 2020-09-27 00:31:51 +00:00
mrg
41f3ac3e09 merge gmp 6.2.0. 2020-09-27 00:30:26 +00:00
mrg
72c7faa4db initial import of GMP 6.2.0. changes include:
- Bug fixes to gmp_snprintf, conversion to double, mpz_powm,
  and mpf_set_str.
- New functions for factorial, primorial, fibonacci, mpz_2fac_ui,
  and mpz_mfac_uiui.
- MIPS r6 cores are now supported.
- Various speeds ups.
2020-09-27 00:27:02 +00:00
roy
0fb7a2c416 rump: Try to fix build 2020-09-27 00:17:56 +00:00
roy
c054c3f155 ifconfig: We already have struct if_data in ifa_data.
So let's not bother with an ioctl we don't need.
2020-09-26 23:43:26 +00:00
thorpej
a639affe04 Implement cpu_intr_redistribute() for Tusnami/Titan systems. 2020-09-26 21:07:48 +00:00
mrg
3169bf0d27 update slightly to enable 'native-gmp' target from tools/gmp to work.
call the awk script on 'config.log', which has (almost) the same output
as the stdout of ./configure, and automatically store it as 'srcs.mk'.
2020-09-26 20:58:48 +00:00
mrg
4dfd2f9831 initial working version of native-gmp support.
does not use mknative.common yet, so always updates files and does
not mark them with NetBSD rcsid.  (not a regression from the manual
version at least.)
2020-09-26 20:56:53 +00:00
mrg
6feeeb58e1 redo much of rev 1.45 and make the _KERNEL path look like it
used to before.

while it uses less total lines of code and looks less ugly,
the merged crash+ddb code here is less correct and harder to
follow for the kernel path.
2020-09-26 20:38:27 +00:00
roy
8c2fc68b9f tap: Remove media from this virtual interface
It serves no purpose at all.
2020-09-26 19:38:45 +00:00
roy
c271800399 vlan: match the interface link state with that of the parent
Now addresses on a vlan will detach and undergo duplicate address
dectection on link state changes just as on a standard interface.
2020-09-26 18:38:09 +00:00
roy
13c88b88b0 net: Add a callback to ifnet to notify of link state changes 2020-09-26 18:35:12 +00:00
jmcneill
c9f4e317e7 Add HAVE_NVMM and use it to control the build of NVMM related components.
Defined to "yes" on amd64, "no" everywhere else.
2020-09-26 17:49:49 +00:00
rillig
d449168a6a make(1): revert migration from Lst_ForEachUntil to Lst_ForEach
There is a crucial difference between these functions, in that
Lst_ForEachUntil can cope with a few concurrent modifications while
iterating over the list.  This is something that Lst_ForEach doesn't do.

This difference led to a crash very early in NetBSD's build.sh.
2020-09-26 17:39:45 +00:00
rillig
073f669ad5 make(1): inline and remove LstNode_Prev and LstNode_Next
These functions made the code larger than necessary.  The prev and next
fields are published intentionally since navigating in a doubly-linked
list is simple to do and there is no need to wrap this in a layer of
function calls, not even syntactically.  (On the execution level, the
function calls had been inlined anyway.)
2020-09-26 17:15:20 +00:00
rillig
5a9725dde8 make(1): inline Lst_ForEach in Targ_PrintGraph 2020-09-26 17:02:11 +00:00
rillig
d8a580cdaf make(1): replace a few Lst_ForEachUntil with simpler Lst_ForEach 2020-09-26 16:55:58 +00:00
rillig
ab003311ea make(1): inline Lst_ForEachUntil in Compat_Make 2020-09-26 16:41:42 +00:00
rillig
1d9026bdfa make(1): clean up obsolete comments about TARG constants 2020-09-26 16:27:27 +00:00
rillig
bc119df081 make(1): remove useless comment from TargFreeGN
GNode.fname is a const char *, therefore it cannot be freed anyway.
2020-09-26 16:21:17 +00:00
rillig
791df18439 make(1): inline Targ_FindNodeImpl
The 3 callers of this function passed different flags, and these flags
led to code paths that almost did not overlap.

It's a bit strange that GCC 5 didn't get that, and even marking the
function as inline did not produce much smaller code, even though the
conditions inside that function were obviously constant.  Clang 9 did a
better job here.

But even for human readers, inlining the function and then throwing away
the dead code leads to much easier code.

This pattern of squeezing completely different code into a single
function has already occurred in a different part of make, though I
don't remember where exactly.
2020-09-26 16:18:44 +00:00
rillig
cf5349557c make(1): clean up API for finding and creating GNodes
The previous API had complicated rules for the cases in which the single
function returned NULL or what it did.  The flags for that function were
confusing since passing TARG_NOHASH would create a new node even though
TARG_CREATE was not included in that bit mask.

Splitting the function into 3 separate functions avoids this confusion.
It also reveals several places where the complicated API led to
unreachable code.  Such code has been removed.
2020-09-26 16:00:12 +00:00
rillig
e58755b1f7 make(1): add test for '::' dependency operator with .ALLTARGETS 2020-09-26 15:41:53 +00:00
rillig
fa7e96862b make(1): replace Hash_FindEntry with Hash_FindValue in Targ_FindNode 2020-09-26 14:59:21 +00:00
rillig
5e8e948275 make(1): add Hash_FindValue, for direct access to hash table data 2020-09-26 14:48:31 +00:00
skrll
0589cefe2f RCSId police 2020-09-26 14:18:06 +00:00
skrll
767a889238 Define isb(), dsb(option), and dmb(option)
Catch up with vchiq upstream to allow this.
2020-09-26 12:58:22 +00:00
roy
a00afd3a07 net: Fix the setting of if_link_state
Link state changes are not dependant on the interface being up, but we also
need to guard against more link state changes being scheduled when the
interface is being detached.

We do this by clearing the link queue but keeping if_link_sheduled = true.
We can check for this in both if_link_state_change() and
if_link_state_change_work() to abort early as there is no point in doing
anything if the interface is being detached because if_down() is called
in if_detach() after the workqueue has been drained to the same overall
effect.
2020-09-26 11:57:05 +00:00
mlelstv
16a709a022 Moving pointers could fail if realloc() allocates a new memory region
where the difference between old and new address exceeds an int. Use
ptrdiff_t for calculations instead.
2020-09-26 11:39:17 +00:00
skrll
b97b06c97c Trailing whitespace 2020-09-26 10:56:37 +00:00
skrll
584896eb82 G/C arm/atomic.h 2020-09-26 10:06:25 +00:00