Commit Graph

738 Commits

Author SHA1 Message Date
thorpej
2685996b0e Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
2021-04-24 23:36:23 +00:00
mrg
384b30b1ad more -fcommon. 2021-04-14 09:29:40 +00:00
mrg
6adfa96ca4 remove shadowed (common) declarations of various libsa variables
from various boot programs.  for macppc and zaurus, avoid building
with -fcommon any more.
2021-04-12 03:55:40 +00:00
thorpej
2cd91599fd Move ofppc-specific CPU spinup code to ofppc/machdep.c 2021-03-05 01:33:33 +00:00
thorpej
34e1127563 Don't include mvgbe in this kernel config; that driver has an explicit
warning for the MULTIPROCESSOR case.
2021-03-05 01:31:43 +00:00
thorpej
1344aafb72 Un-do a bunch of misguided code sharing. It's not really shared if it's
full of platform-specific #ifdefs:
- ofwoea_batinit() is gone; just do what's needed early in macppc / ofppc
  initppc() functions.
- Get a bunch of Mac-specific stuff out of ofwoea_initppc().
2021-02-27 02:52:48 +00:00
thorpej
31c71552cd Declare oeacpufeat once, in powerpc/oea/cpu_subr.c, rather than in
N different locore.S files.
2021-02-26 02:18:55 +00:00
thorpej
7f284be351 Document the register state on entry per the OpenFirmware PowerPC CPU
bindings.  Ensure we save off %r6 and %r7 before calling any other
functions.
2021-02-17 23:21:46 +00:00
christos
8a22b2177e Document via __HAVE_BUS_SPACE_8 platforms that implement bus_space_*_8 2021-01-23 19:38:51 +00:00
nia
f3ec8521a0 add a commented out compat_ossaudio wherever there's compat_linux
requested by mrg
2021-01-21 06:51:54 +00:00
phx
26c1d7d861 Message buffer is too small, since timestamps were enforced. 2020-11-29 12:38:44 +00:00
thorpej
192b994748 malloc(9) -> kmem(9) 2020-11-21 17:48:26 +00:00
roy
98f3a8d458 vether: Add to kernel configurations
It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
2020-09-27 13:48:49 +00:00
mrg
a8fd7c84b2 partial port to powerpc64. 2020-09-15 08:14:31 +00:00
maxv
b84521f2f3 Remove references to BRIDGE_IPF, it is now compiled in by default. 2020-08-01 08:20:47 +00:00
thorpej
ca8ce3aeb1 Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
  Provide a new resource provider API:

  ==> pciconf_resource_init() -- Initialize a PCI configuration resources
      container.
  ==> pciconf_resource_add() -- Add a PCI configuration resource to the
      container (I/O, MEM, or prefetchable MEM).  Multiple resources of
      each type may be added.
  ==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
      container once the bus has been configured.

  This is much easier to use than the previous method of providing an
  extent map for each kind of resource, and works better for e.g. ACPI
  platforms that provide potentially multiple PCI resources in tables
  provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
  rather than extent maps.
2020-07-07 03:38:45 +00:00
rin
7a83765833 It turned out that using some Open Firmware routines causes the system
freeze after calling OF_quiesce().

This is why setting color palette crash the system for some Power Mac G5
models, like PowerMac11,2.

Therefore, stop using color-palette and backlight callbacks for genfb(4)
in this case.

Also, postpone OF_quiesce() after rascons_init_rasops(), and initialize
color palette there if OF is going to be quiesced and color depth is 8.

Now, color palette for wscons is initialized correctly for PowerMac11,2.
2020-07-07 02:33:54 +00:00
chs
69a3e9b705 replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
2020-06-14 01:40:02 +00:00
maya
5cf9e8b81f Remove uyap, USB YAP phone firmware loader.
And the associated ezload EZ-USB code, which is only used by uyap.
It could theoretically be used by other drivers, but none of them are
in tree.

I suspect that this device isn't in use, as phone technology has improved
a lot since 2001 when uyap(4) was added to the tree.

Proposed with no objections on netbsd-users on 13 April 2020
2020-05-16 13:46:10 +00:00
chs
d47bcd296c in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
2019-11-10 21:16:21 +00:00
sevan
75d6e670be Enable BUFQ_PRIOCSCAN, CARP, Veriexec by default in GENERIC kernel configs.
On ports without a GENERIC kernel config enable in individul files, e.g evbmips.
Omit on:
atari, dreamcast, emips, epoc32, evbppc/VIRTEX*, ia64, luna68x, mvme68k,
mvmeppc, playstation2, riscv, sun2, sun3, x68k, zaurus due to resource
constraints or port infancy.
2019-04-26 21:40:28 +00:00
christos
021d832a13 centralize setdisklabel(9) 2019-04-03 22:10:49 +00:00
rin
56d037034f Add ure(4) to kernel config files. Also add PHY drivers where necessary. 2019-02-06 11:58:30 +00:00
mrg
3d2bd524de workaround a problem with the pegasos firmware interface:
attempting to use /dev/openfirm on this machine hangs hard.

this isn't a new problem, and i've been meaning to try to
figure it out for years, but it's become a problem since
the xf86-video-radeon driver gained code to look for the
macppc model using this interface.

this is why xorg-server 1.18 and 1.20 hang recently on the
pegasosII.


this change is fairly ugly but i couldn't think of a less
ugly method to avoid /dev/openfirm working just on this
one platform.  introduce new __OPENFIRMIO_OPEN_CHECK_BROKEN
macro and associated __openfirmio_open_check_broken(), and
use them in the new openfirmopen() to fail opens.

include proplib.h in macppc and ofppc autoconf.h since they
use it.
2019-01-08 07:46:10 +00:00
jdolecek
ef2b5d4f55 remove the 'wd* at umass?' for the non-standardized and rare (extinct?)
In-System Design ATA protocol over Bulk-Only devices from most kernels,
leave only in i386/amd64 ALL; it's unmaintained and likely currently broken,
lack of test hardware makes it impossible to support
2018-10-23 19:58:52 +00:00
riastradh
d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
rin
46f2680da4 Add (commented out) mue(4) to where appropriate.
Also add MII/PHY drivers for USB NICs if missing.
2018-08-25 20:52:40 +00:00
maxv
f71d13bdf7 Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
2018-08-01 20:04:09 +00:00
maxv
94924a7495 Retire ipkdb entirely. The option was removed from the config files
yesterday.

ok kamil christos
2018-07-15 05:16:40 +00:00
maxv
62c8988166 Remove the kernel PMC code. Sent yesterday on tech-kern@.
This change:

 * Removes "options PERFCTRS", the associated includes, and the associated
   ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
   good.

 * Removes the PMC code of ARM XSCALE.

 * Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

 * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
   definitions are put in sysarch.h.

 * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
   and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
   netbsd32 and rump.

 * Removes the pmc_evid_t and pmc_ctr_t types.

 * Removes all the associated man pages. The sets are marked as obsolete.
2018-07-12 10:46:40 +00:00
skrll
e3cfa66d2e Generalise FDT and OFW 2017-12-18 15:53:38 +00:00
mrg
95772a8862 clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
  since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
  many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
2017-09-14 07:58:38 +00:00
sevan
684872c792 Remove support for VERIFIED_EXEC_FP_RMD160, VERIFIED_EXEC_FP_SHA1, and VERIFIED_EXEC_FP_MD5 options.
These algorithms are either broken or on their way to being broken.

Discussed on tech-security
http://mail-index.netbsd.org/tech-security/2017/08/21/msg000936.html

ok riastradh
2017-09-13 22:24:42 +00:00
maxv
5f6e25a19d Remove TCP_COMPAT_42 from the config files. Pass 3. 2017-07-29 18:08:56 +00:00
christos
cb5e99c661 centralize vers.c building for standalone programs. 2017-04-08 19:53:19 +00:00
mrg
99572bea7b fix some printf formats in DIAGNOSTIC code. 2017-03-05 22:14:51 +00:00
rin
59e6f8272e Add DKWEDGE_METHOD_RDB option, which is enabled for x86, commented out for
other platforms by default.
2017-02-26 12:03:14 +00:00
christos
e4cf317682 provide __HAVE_COMPAT_NETBSD32 and fix multiple include protection consistently. 2017-01-26 15:55:08 +00:00
christos
edd2c34241 PR/51827: David Binderman: delete pointless local variable 2017-01-11 18:19:29 +00:00
christos
ef2deb33e0 wildcard speaker attachments, now that we can handle many of them. 2016-12-13 20:42:15 +00:00
christos
219b8dae14 remove VAUDIOSPEAKER for now, will be done differently. 2016-12-10 23:03:22 +00:00
nat
03783bb56a Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
2016-12-08 11:31:08 +00:00
nonaka
e4a54b4193 Added MSI/MSI-X and interrupt_distribute(9) support for powerpc. 2016-10-19 00:08:41 +00:00
jdolecek
e1d3e1b041 add isa_intr_establish_xname() to MD isa headers so that it can be used
by MI drivers
2016-10-18 22:04:33 +00:00
dholland
8834e2f574 PR 51200 gets in libsa considered harmful: use kgets 2016-06-11 06:35:00 +00:00
christos
40d9145b70 PR/51015: David Binderman: remove useless code 2016-03-30 21:14:54 +00:00
christos
257ef94e95 Add mips fenv.h (From FreeBSD) 2015-12-21 17:02:32 +00:00
christos
c6ad517cd0 new powerpc fenv.h 2015-12-20 16:23:38 +00:00
maxv
d42b2b5ae7 Remove KMEMSTATS. Normally it's ok now. 2015-09-26 11:16:12 +00:00
dholland
25d3b9e7cb Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
2015-09-07 03:49:44 +00:00