Commit Graph

1866 Commits

Author SHA1 Message Date
thorpej
daca0f564b Refactor the 68040 writeback() from each m68k port's trap handler into a
shared copy: m68040_writeback().  It is essentially a copy of the Atari
version, with some minor cosmetic tweaks and one small performance optimization
from the mvme68k port.

Tested by rjs@ on a Quadra 950.  (Thanks!)
2019-02-18 01:12:22 +00:00
mrg
8255ce9ee0 make *fd*.c's fd_dev_to_type() always a static inline. some
have it as a const, and have code to copy the defaults to
modify them before using them, but that probably requires a
real test to feel confident in changing.
2019-02-08 08:47:35 +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
dholland
810a783361 Systematize handling of removed drivers.
- Every driver that was removed and whose number hasn't already been
   reused is now listed with a commented-out "obsolete" line.
 - The format of these has been systematized. Future format changes can
   probably be safely done with a script.
 - This does not include a few cases of assignments that only lasted a
   couple days, or stuff from before major reorgs. Some of these may
   be included nonetheless, because there was a lot of ground to cover
   and therefore not a lot of time to dig into history in detail.

Note that the obsolete listings do not mean the major numbers can
never be reused; that's up to portmasters and/or core. It does mean
that they won't be reused by accident, however, which in some cases
(depending on the driver, how widely used it was, its family of device
nodes, their default permissions, etc.) can be quite dangerous.

Note that some of the things now explicitly listed as obsolete are
really ancient history. My scan went back as far as when the majors
files were added. (But not before that.)
2019-01-28 02:28:56 +00:00
dholland
7d910266fe fix duplicated chunk from merge 2019-01-27 05:06:35 +00:00
pgoyette
d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
christos
16da66b882 use the right version of ELF2AOUT 2019-01-02 00:48:13 +00:00
christos
12c2d25336 use elf2aout for boot. 2018-12-31 19:25:46 +00:00
maxv
43c9320743 Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
2018-12-19 13:57:44 +00:00
thorpej
6d4870476f Clean up initialization of com_regs structure, in preparation for
some additional changers.
2018-12-08 17:46:09 +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
maxv
ebec90347e Remove ISDN from the kernel. It has remained unmaintained for a long time,
is of poor quality, and is now an obstacle to MP-ification. It was removed
ten years ago from FreeBSD for the same reason.

This retires a big user of the mbuf API, and will ease maintenance of the
kernel.
2018-09-23 09:20:57 +00:00
rin
e9ac1fc994 - Determine KERN_AS automatically depending on whether OPT_MODULAR is
set or not, in the same way as libcompat.

- Specify OPT_MODULAR in the port Makefile instead of KERN_AS.

Now, KERN_AS=library is used for kernels without module(7) for all ports.

OK christos
2018-09-22 12:24:01 +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
msaitoh
61e1eb0d0b - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
  - Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
  use them on all m68k machines.
2018-08-22 01:05:21 +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
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
msaitoh
4b508fb16e It's not required to include net/bpfdesc.h. Remove it. 2018-06-22 04:17:40 +00:00
christos
ed4b3b9b47 more NOMAN= removal. 2018-05-01 20:15:11 +00:00
christos
bf7113376a Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
2018-05-01 19:59:42 +00:00
mrg
b63cf4b769 add a special rule to build m68k/fpu.c to avoid passing -msoft-float.
fixes GCC 6 kernel builds that use this file.
2018-02-25 00:27:16 +00:00
dholland
32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
maxv
07316f2d3f Nuke DIRECTED_BROADCAST, it is not documented and not enabled anywhere. It
probably wouldn't have built correctly anyway, since there is no associated
defflag.

These ten lines of code in ip_input.c already look a lot better.
2018-02-05 15:18:10 +00:00
sevan
b376ef7f24 Alternate buffer queue strategies no longer considered experimental, update
description.

Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
2018-01-23 14:47:53 +00:00
christos
dc2ac29584 Cleanup and clarify the ELFSIZE mess:
We now have 2 variables automatically set in elf_machdep.h:

    ARCH_ELFSIZE: the size for userland binaries
    KERN_ELFSIZE: the size for the kernel binaries

DB_ELFSIZE has been deleted and KERN_ELFSIZE should have always the
same values DB_ELFSIZE used to have.

In sys/exec_elf.h, if ELFSIZE is not set, it is set to KERN_ELFSIZE
for the kernel and ARCH_ELFSIZE for userland. These defaults should
eliminate the need for most manual ELFSIZE setting.
2017-11-06 03:47:45 +00:00
maya
18b796d442 Use C99 initializer for filterops
Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- 	{ a, b, c, d
+ 	{
+ 	.f_isfd = a,
+ 	.f_attach = b,
+ 	.f_detach = c,
+ 	.f_event = d,
};
2017-10-25 08:12:37 +00:00
isaki
ba920338cd Avoid magic numbers and give appropriate names. 2017-09-30 04:07:04 +00:00
christos
5952c072ab pass the correct argument 2017-09-15 03:12:05 +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
isaki
05338f8c10 - Finally MI audio supports 4bit precision format without null_filter hack!
- Fix reusing play/rec argument as local variables.  It is in/out parameter.
2017-09-02 15:40:31 +00:00
isaki
c939a3b265 - Revert temporary local conversion introduced at rev 1.43.
- But does not revert to trigger method.  trigger method is not suitable for
  x68k ADPCM+DMA mechanism.
- Don't (re)start ADPCM when DMA is running.  This solves the noise.
  From Y.Sugahara.
- Cache dmac xfer.
2017-09-02 12:52:55 +00:00
isaki
ac90edd392 Fix a Continue Operation.
Patch from Y.Sugahara.
2017-08-11 07:30:01 +00:00
isaki
f5c75e2eda Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
2017-08-11 07:08:40 +00:00
isaki
e30341807e Use dmac_prepare_xfer().
From Y.Sugahara.
2017-08-11 06:47:35 +00:00
isaki
316d9c5461 Merge prate and rrate. These can not be separated. 2017-08-05 06:05:37 +00:00
isaki
d25d619221 vs(4) became to able to play audio again.
At the moment the encoding conversion using set_params() does
not seem to work for me.  So vs(4) uses local conversion to/from
ADPCM instead of it.  But this should be a temporary work.
XXX The playback quality is very poor compared to before...
XXX Recording is not tested.
2017-08-05 05:53:26 +00:00
isaki
cfb7f48960 Remove temporary VS_USE_PREC8 option.
vs(4) now supports slinear16be and slinear8 (but now work yet).
2017-08-05 05:22:55 +00:00
isaki
7ae81f3285 Update confused vs_set_params().
play and rec are identical but pfil and rfil are independent.
XXX I introduce VS_USE_PREC8 option for debugging purposes
    temporarily.  I'll remove it if the problem is solved.
2017-07-31 14:53:08 +00:00
maxv
5f6e25a19d Remove TCP_COMPAT_42 from the config files. Pass 3. 2017-07-29 18:08:56 +00:00
nat
6a19d790db Audio vchan auto config works again due to the use of a null_filter.
Tested and confirmed working by isaki@.
2017-07-29 07:30:39 +00:00
isaki
5c899c2dfd Catch up vs_set_params() to recent MI audio (after in-kernel mixer).
Before that, MD part had to support all encodings I'd like to support,
but currently it's no longer necessary.  The hardware is
4bit/1ch/15.6kHz ADPCM but it behaves as 16bit/1ch/16.0kHz PCM.

For audio.c < 1.362, the device attach succeeded and playback is
still working.
For audio.c >= 1.363, the device attach fails again.
It does not work yet but I commit it for milestone.
2017-07-09 12:49:26 +00:00
isaki
57e298b4f8 Avoid panic when the device is closed when not playing. 2017-06-25 06:26:40 +00:00
chs
fd34ea77eb remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
2017-06-01 02:45:05 +00:00
christos
cb5e99c661 centralize vers.c building for standalone programs. 2017-04-08 19:53:19 +00:00
christos
b3cf0d41b0 PR/52135: David Binderman: Fix loop bounds checking. 2017-04-03 17:37:29 +00:00
rin
9e3d987a53 PR port-mac68k/51923
Bump default MAXTSIZ to 32MB for m68k ports, which allos us to use GCC 5.4 on
GENERIC kernels.
Ok jklos
2017-02-02 21:53:54 +00:00
rin
6eadace49f PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos
2017-02-02 21:50:22 +00:00
isaki
e9bbb736c5 Fix the possibility of off-by-one on the grammer. Reported by coypu.
Currently it never happens because type is (minor number % 7) and
the arraycount of fd_types[] is 8.  I.e., it is a dead code...
However, when the capacity of the FDTYPE() changes or the arraycount
of fd_types[] changes, this correction will be effective.
2017-01-12 14:24:53 +00:00