Commit Graph

287330 Commits

Author SHA1 Message Date
christos
5f835dcadf appease gcc-9 2021-04-17 00:02:19 +00:00
christos
e598b150b9 PR/56112: Justin Parrott: Don't unlink a lock file without locking it, because
you can have races when multiple processes try to unlink it. Check the link
count to see if we have won the race.

While here:
- use snprintf
- use warn
- use size_t/ssize_t
- use loops instead of goto
- KNF
2021-04-16 22:41:12 +00:00
christos
4a8f7c3df0 make value an int to avoid all the casts and conversion warnings. 2021-04-16 18:31:28 +00:00
rillig
9e5a82eed4 make: use distinct wording for writing to the shell commands file
The word 'write' now means to write to the file that holds the shell
commands to be run later.

The word 'print' is now used exclusively for handling the output of the
child commands and printing them to make's stdout.

No functional change.
2021-04-16 16:49:27 +00:00
rillig
32bd955566 make: align name of jobs_table_dump to the other functions 2021-04-16 16:10:01 +00:00
pgoyette
f9d5d6d2d4 Add a couple definitions for RPG 2021-04-16 15:53:55 +00:00
christos
f1d025f4e1 Change octal and hex parsing to not use strtoul so that they don't handle
'-'. From Martijn van Duren.
Also add a warning if the conversion fails (like the gnu printf does)
2021-04-16 15:10:18 +00:00
christos
9777eb9aeb go back to right-aligning the titles for CPU and WCPU. 2021-04-16 13:02:47 +00:00
reinoud
519a7d1514 Limit buffer size for device capabilities requests as a work-around for PR
kern/56109.
2021-04-16 12:58:54 +00:00
ryo
65707115ac fix typo 2021-04-16 08:09:40 +00:00
ryo
255ce3d45d when the packet size was just n*MCLBYTES, there was an inconsistency in the length of mbuf. 2021-04-16 08:07:02 +00:00
msaitoh
882c1780be - Remove obsolete cltom(9) and mtocl(9).
- Add missing manual page's link of m_adj.
2021-04-16 07:45:41 +00:00
skrll
b6f5691d57 spello in comment 2021-04-16 07:02:09 +00:00
rin
efb1d0a1d1 Restore our local change to remove GNU_STACK program header:
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c#rev1.13

This was removed accidentally when merging GCC10 into our tree.

Note that some firmwares, e.g., Explora, refuse to execute ELF
kernel image if this program header is present.

Now, GCC10 becomes just fine for all three powerpc sub-archs, i.e.,
oea, booke, and ibm4xx, as far as I can see. No regressions are
observed for ATF.

OK mrg
2021-04-16 02:33:28 +00:00
rin
3d5cb49cde Fix regression introduced to GCC10, where it wrongly recognizes 32-bit
processors as POWER9 if -misel flag is specified.

rs6000_machine_from_flags() assumes ISEL instructions are supported only
for POWER9 and successors. However, ISEL is also implemented for 32-bit
booke processors.

Since our kernel for booke is compiled with -misel, this regression
completely breaks it.

As a fix, check whether CPU is 64-bit capable or not, before checking
-misel flag.

The problem has been reported as 100108 to upstream:

	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100108

OK mrg
2021-04-16 02:26:43 +00:00
yamaguchi
db6b169977 Added missing locking order between sppp and IFNET_LOCK 2021-04-16 02:26:25 +00:00
yamaguchi
3955989b41 Stop and destroy timeout after sppp_detach and if_detach
for safety

The functions may use resources of pppoe(4) while detaching,
so the release should move after it.
2021-04-16 02:23:25 +00:00
rin
3467bd47be Fix regression introduced to GCC10, by which inline assembler codes for
403/405 are miscompiled.

Redundant .machine directive introduced by upstream commit
2d94f7dea9c73ef3c116a0ddc722724578a860fe:

	https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=2d94f7dea9c73ef3c116a0ddc722724578a860fe

clobbers CPU flags passed to assembler. This results in miscompile for
inline assembler codes specific to 403/405 processors, at least.

Therefore, revert this commit locally.

The problem has been reported as 100107 to upstream:

	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100107

OK mrg
2021-04-16 02:18:04 +00:00
yamaguchi
67c987e115 Remove unnecessaly lock holdings to avoid dead lock
The locks were held while callout_halt() and workqueue_wait()
without reason.
And the locks also were held at callout and workqueue handler
so that the handler kicked by those function couldn't acquire
the lock.

The reasons why those are unneccesary are:
 - Items of callout_t are protected by callout_lock
 - Items of struct workqueue and struct work are protected
   by q_mutex in struct workqueue
 - Items of struct sppp_work protected by atomic_cas(3)
 - struct pppoe_softc does not free before workqueue_wait() and
   callout_halt() even if the locks are not held
2021-04-16 02:12:00 +00:00
yamaguchi
d0255047d4 Fix not to put the wrong error message 2021-04-16 02:05:37 +00:00
yamaguchi
382b1e495e Stop ppp layer at first of destroying pppoe interface 2021-04-16 01:59:50 +00:00
yamaguchi
ab945900b9 Sort initialization sequence in pppoe_clone_create() out
for refactoring

It has no functionality impact
2021-04-16 01:44:35 +00:00
yamaguchi
4e6f0c603c Use kmem_zalloc to allocate pppoe_softc 2021-04-16 01:32:04 +00:00
yamaguchi
324c3dd663 Move initialization of sc_lock in pppoe_softc to first
The lock may be held in callbacks for ppp layer or other
components so that it should be initialized early.
2021-04-16 01:28:51 +00:00
yamaguchi
87f753dafa commonize error handling in pppoe_clone_create() 2021-04-16 01:24:35 +00:00
mrg
5375303359 restore gcc-8 subdirs and mark as obsolete. oops.
noted by pgoyette.
2021-04-16 01:14:38 +00:00
mrg
73171c26e4 check the result value of pmap_extract() and panic if it fails.
this is a "should never fail" case, and GCC 10 noticed that it
allows an uninitialised variable use.

tested by rin@ on amiga and mac68k.
2021-04-16 00:13:48 +00:00
rillig
87e1399e00 make: remove type name for the abort status in job handling 2021-04-15 19:06:42 +00:00
rillig
b089333f2a tests/make: demonstrate handling of null bytes 2021-04-15 19:02:29 +00:00
rillig
b1928e38b6 make: rename PrintOutput to PrintFilteredOutput to avoid confusion
In the default configuration, the function PrintOutput did nothing.
Only if the shell has defined an output filter, something happens at
all.
2021-04-15 18:36:17 +00:00
rillig
d11aa0ae3d make: document two previously unknown bugs in job mode 2021-04-15 18:21:27 +00:00
christos
0f62dc0eb2 fix reversed comment 2021-04-15 17:31:15 +00:00
christos
4ddba2f693 - Define NEED_ISYSTEM here
- include <bsd.init.mk> now that we can do it, because we need Makefile.rump
  to be included first, so that NOLINT gets defined, so that we don't end up
  building lint modules just for this.
2021-04-15 17:28:09 +00:00
christos
06788510d9 - Don't define NEED_ISYSTEM. This is a rump thing and should be only exposed
there.
2021-04-15 17:26:22 +00:00
christos
e3e40d48f1 - Don't include <bsd.own.mk> It should be done by the enclosing Makefile
- Don't define NEED_ISYSTEM. This is a rump thing and should be only exposed
  there.
2021-04-15 17:26:07 +00:00
tsutsui
669338939e Fix two problems on old topcat(4) framebuffers found on HP332/340.
- Fix panic on monochrome framebuffers. They don't have palette registers.
  The problem was reported from Anders Gustafsson and also Andrew Gillham
  back in 2013:
   https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000086.html
   https://mail-index.netbsd.org/port-hp300/2013/09/28/msg000087.html
- Fix incorrect framebuffer width of 98542/98544 framebuffers on HP332.
  Reported from Andrew Gillham (98542) as above and Chris Hanson (98543):
   https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000083.html
   https://mail-index.netbsd.org/port-hp300/2020/05/01/msg000164.html

Worth to pullup to netbsd-9.
2021-04-15 14:43:19 +00:00
ryo
117e65d3d3 mtu for revision B0 and B1 is supported up to 16338 bytes 2021-04-15 09:05:24 +00:00
ryo
acf609b610 fixed the problem of instability when changing mtu in IFF_UP state 2021-04-15 09:04:42 +00:00
ryo
ff3bc245ed add support hardware tcp/udp rx checksum offloading 2021-04-15 09:04:08 +00:00
rin
0bb52ad971 Fix fallout from alpha/interrupt.c rev 1.93:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/alpha/alpha/interrupt.c#rev1.93

by which interrupts *seem* to occupy 100% CPU time.

Now, we bump ci_intrdepth for clock interrupt. Therefore, if ci_intrdepth > 1
is observed in statclock(), CPU is actually occupied by interrupts.

Thanks jklos and thorpej for notice!
2021-04-15 08:23:24 +00:00
christos
8ffea519f1 avoid second typedef for boolean_t in kernel code originally defined in
<sys/types.h>
2021-04-15 07:00:50 +00:00
christos
2cb1b4dc1d remove extra typedef for vnode_t done in <sys/vnode.h> 2021-04-15 06:59:57 +00:00
mrg
8842784405 document various gcc warnings that occur frequently enough to
inspire the GCC_NO_* series of variables, and explain some
about what the issues may be for each, hopefully providing some
direction on how to fix new warnings in this space.

christos asked me for this last year, and it's finally complete
enough to commit.  :-)
2021-04-15 05:15:04 +00:00
mrg
f83306c1b9 feedback from rin@: alpha and m68k work well, powerpc not so much
but fixes are known.

thanks!
2021-04-15 05:12:57 +00:00
mrg
5cf114ea09 i've test-built all platforms. everything except arm64, x68k and sun2
builds.  many of them work as well.  most mips are (minimally) tested.
2021-04-15 01:59:51 +00:00
mrg
667f151ae6 convert 'extern phys_ram_seg_t mem_clusters[0];' to the '[]' form
so that when this code accesses mem_clustes[0] and mem_clusters[1]
it does't reach out of bounds.

XXX: should be in a header, but it's ugly to fix and i stopped
     when bus_dma.c wouldn't build.
2021-04-15 01:57:11 +00:00
mrg
90cb3f8f93 vax vs gcc: fsdb.c loses. also build this with -O0. 2021-04-15 01:56:00 +00:00
mrg
e6d9bbbe8f one port complains about string overflow here that i can't see. 2021-04-15 01:55:21 +00:00
mrg
5def991c6d more -fcommon for boot programs. 2021-04-15 01:54:38 +00:00
rin
faefc63d20 intrcnt[] is changed from long to u_int. Use sizeof(var) instead of
sizeof(type) to catch up with this change.

No binary changes as all ports with __HAVE_LEGACY_INTRCNT are ILP32, IIUC.
2021-04-15 00:37:31 +00:00