Commit Graph

77 Commits

Author SHA1 Message Date
thorpej
38e52ce4ec malloc(9) -> kmem(9) (easy, straight-forward cases only, for now) 2020-11-22 03:55:33 +00:00
skrll
5e6a531eb4 Adjust egister usage so that r4 and r5 are preserved as cur{cpu,lwp}
respectively as required by the change to make ASTs operate per-LWP
rather than per-CPU.  DO_AST_AND_RESTORE_ALIGNMENT_FAULTS expects this.

Remove the call to dosoftints while I'm here as it's dont in DO_AST...

XXX untested
2020-11-21 19:57:35 +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
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
ryo
509197b672 use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
2018-03-16 17:56:31 +00:00
skrll
30c9a55143 whitespace 2018-01-30 19:22:28 +00:00
martin
40dee5e97f Implement {pci,isa}_intr_disestablish 2017-03-12 10:19:40 +00:00
macallan
96aa345620 teach isa_bs_mmap() about BUS_SPACE_MAP_PREFETCHABLE
use the right paddr for chipsfb
2016-08-26 22:19:48 +00:00
macallan
09f7d94b45 add the same special casing for chipsfb as we already do for igsfb to
isa_bs_mmap()
2016-08-26 20:19:45 +00:00
msaitoh
8bc54e5be6 KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +00:00
christos
46923cbe5b fix leak 2014-09-21 15:48:29 +00:00
matt
53872253af include <arm/locore.h> 2014-02-22 18:56:25 +00:00
joerg
8b058f850e Don't use cpsr_all/spsr_all with mrs, it doesn't take a mask. 2013-12-02 18:36:10 +00:00
matt
029a1f3b59 Update to unified syntax 2013-08-12 17:32:03 +00:00
chs
cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
matt
5cb635c383 Switch to the generic bounce buffer support. 2012-09-21 14:21:57 +00:00
matt
4395f61bf8 Don't use r7, use r5 instead 2012-09-03 16:35:33 +00:00
matt
09fb7d24ff Convert stragglers to use real C89 prototypes. 2012-01-31 04:28:50 +00:00
dyoung
703fe5ba82 Change <machine/bus.h> to <sys/bus.h> throughout.
Split bus.h -> bus_{defs,funcs}.h.
2011-07-19 15:07:42 +00:00
matt
6a66466f0c Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits.  Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
2010-12-20 00:25:23 +00:00
dyoung
fdeb7750f8 isa_detach_hook() needs two arguments, the first an isa_chipset_tag_t. 2009-08-19 15:11:22 +00:00
dyoung
47b66b70d9 These are stragglers from my last commit ("Let us safely detach
the ISA bus and devices attaching to the ISA bus").  Define
isa_detach_hook() in MD ISA implementations.  Define isa_dmadestroy().
2009-08-18 17:02:00 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
dsl
7cc9af7d64 ANSIfy functions with function-pointer arguments 2009-03-16 23:11:09 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
dsl
02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
matt
825088eda6 Merge kernel changes in matt-armv6 to HEAD. 2008-04-27 18:58:43 +00:00
matt
ace1262f40 current_intr_depth is dead. kill it off for good. 2008-01-06 03:01:59 +00:00
matt
e7574fcb84 Make sure interrupt handler is updating curcpu()->ci_depth 2008-01-06 01:19:42 +00:00
ad
503fb6483e A quick hack to make cpu_intr_p() work on shark. Needs to be fixed
properly by someone who does arm assembly.
2008-01-06 00:56:18 +00:00
ad
4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
garbled
d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00
tsutsui
320e4f3fc5 Remove all references to spl_mask. Now it isn't used by any sources.
Discussed on port-arm.
2007-08-13 02:04:50 +00:00
tsutsui
5c47006ea3 In irq_setmasks(), refer spl_masks[current_spl_level] directly
rather than spl_mask which is a saved value in splraise() and
splx() functions because the latter one is not always sync'ed with
current_spl_level and interrupt state could be mangled.

Okay'ed by chris@, and should close PR port-shark/22355.
2007-08-13 01:55:31 +00:00
tsutsui
72e8fd4495 Make clockintr() return 1 since it's always handled so that
clock interrupt is properly acounted by evcnt(9) in isa_irq.S.
2007-08-04 20:14:21 +00:00
thorpej
165d4e6d83 Rewrite the ARM mutex implementation to be of the simple-mutex variety.
Because pre-v6 ARM lacks support for an atomic compare-and-swap, we
implement _lock_cas() as a restartable atomic squence that is checked
in the IRQ handler right before AST processing.  (This is safe because,
for all practical purposes, there are no SMP pre-v6 ARM systems.)

This can serve as a model for other non-MP platforms that lack the
necessary atomic operations for mutexes (SuperH, for example).

Upshots of this change:
- kmutex_t is now down to 8 bytes on ARM; about as good as we can get.
- ARM2 systems don't have to trap and emulate SWP or SWPB for mutexes.

The acorn26 port is not updated by this commit to do the LOCK_CAS_CHECK.
That is left as an exercise for the port maintainer.

Reviewed and tested by Matt Thomas.
2007-03-09 19:21:57 +00:00
matt
004b1a75b4 Make sure to include IPL_SOFT* and IPL_STATCLOCK when setting up IRQ masks. 2007-03-09 18:20:51 +00:00
matt
d471ccf3aa Clean the bitrotting ofw code. Don't export export the underlying irq
dispatch mechanism to the rest of the kernel; they don't need to know.
Nuke IRQSTATS entirely.

XXX ofwgencfg_clock needs to taught about timecounters
2007-03-08 20:48:39 +00:00
christos
5ebcdbe8b5 fix caddr_t fallout. 2007-03-04 10:21:25 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
matt
2c6d199d35 Switch shark from intrcnt to evcnt 2007-02-20 01:51:16 +00:00
matt
f2151241de Move softintr_init from irq_init to cpu_configure. 2007-02-19 21:38:37 +00:00
matt
981ae6645d Don't export spl_smasks or soft_interrupts. They are local to intr.c
Make sure that softintr_init() is called when needed.
Assume __HAVE_GENERIC_SOFT_INTERRUPTS is defined (since newlock2 requires it).
2007-02-18 07:48:20 +00:00
matt
37f7079751 Call softintr_init() 2007-02-18 07:20:40 +00:00
macallan
ed57b01256 add bus_space_*_stream() methods 2007-01-21 23:19:57 +00:00
macallan
0e7f627c30 add glue for igsfb at ofbus 2006-12-07 03:10:14 +00:00
gdamore
40774842f0 Convert shark to timecounters. Tested by numerous folks, ok christos@,
martin@.
2006-09-13 07:13:03 +00:00
gdamore
01beb29b30 ANSIfy & KNF. 2006-09-12 17:07:14 +00:00