Commit Graph

300 Commits

Author SHA1 Message Date
cognet
620f6bb4da Allocating the memory for the kernel stack one time is enough. 2005-04-27 13:29:54 +00:00
cognet
2e22e4d43a Don't use fusufault in casuptr(), as it assumes the current PCB will be
stored in r2, which can't be easily done with casuptr(). Introduce
casuptrfault instead.
2005-04-23 16:45:04 +00:00
davidxu
453fe8ab9c Change cpu_set_kse_upcall to more generic style, so we can reuse it
in other codes. Add cpu_set_user_tls, use it to tweak user register
and setup user TLS. I ever wanted to merge it into cpu_set_kse_upcall,
but since cpu_set_kse_upcall is also used by M:N threads which may
not need this feature, so I wrote a separated cpu_set_user_tls.
2005-04-23 02:32:32 +00:00
marcel
c33159bae0 Add empty header (except of the multiple-inclusion protection) to
get hwpmc(4) to compile on this platform.
2005-04-20 18:44:53 +00:00
imp
1554f0784f Break out the definition of bus_space_{tag,handle}_t and a few other types
into _bus.h to help with name space polution from including all of bus.h.
In a few days, I'll commit changes to the MI code to take advantage of thse
sepration (after I've made sure that these changes don't break anything in
the main tree, I've tested in my trees, but you never know...).

Suggested by: bde (in 2002 or 2003 I think)
Reviewed in principle by: jhb
2005-04-18 21:45:34 +00:00
cognet
c89d7c66d2 Unbreak the vector_page == 0x00000000 case. Map the vector page L1PT into the
kernel domain for each pmap, as we don't update the page table when we're
switching to a kernel thread, but we do however update the DACR.
2005-04-14 14:32:32 +00:00
cognet
de18fb7c07 pmap_update() is gone. 2005-04-13 16:02:03 +00:00
jhb
e5a9dc7c11 Use PCPU_LAZY_INC() for cnt.v_{intr,trap,syscalls} rather than atomic
operations in some places and simple non-per CPU math in others.
2005-04-12 23:18:54 +00:00
cognet
254df829c8 We have an asm version of bcmp(), so we could use it as well. 2005-04-12 22:46:09 +00:00
cognet
e1cd030061 Don't announce the range SDRAM_START-freemempos until I figure out what's
going on, it produces random memory corruption.
2005-04-07 22:04:18 +00:00
cognet
42d91d88c7 pmap_update() is gone. 2005-04-07 22:03:34 +00:00
cognet
36756c5ce0 Import a basic implementation of the restartable atomic sequences to provide
atomic operations to userland (this is OK for UP only, but SMP is still so
far away).
2005-04-07 22:03:04 +00:00
cognet
d50f4f728e - Try harder to report dirty page.
- Garbage-collect pmap_update(), it became quite useless.
2005-04-07 22:01:53 +00:00
jhb
31d043752b Divorce critical sections from spinlocks. Critical sections as denoted by
critical_enter() and critical_exit() are now solely a mechanism for
deferring kernel preemptions.  They no longer have any affect on
interrupts.  This means that standalone critical sections are now very
cheap as they are simply unlocked integer increments and decrements for the
common case.

Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter()
and spinlock_exit().  This KPI is responsible for providing whatever MD
guarantees are needed to ensure that a thread holding a spin lock won't
be preempted by any other code that will try to lock the same lock.  For
now all archs continue to block interrupts in a "spinlock section" as they
did formerly in all critical sections.  Note that I've also taken this
opportunity to push a few things into MD code rather than MI.  For example,
critical_fork_exit() no longer exists.  Instead, MD code ensures that new
threads have the correct state when they are created.  Also, we no longer
try to fixup the idlethreads for APs in MI code.  Instead, each arch sets
the initial curthread and adjusts the state of the idle thread it borrows
in order to perform the initial context switch.

This change is largely a big NOP, but the cleaner separation it provides
will allow for more efficient alternative locking schemes in other parts
of the kernel (bare critical sections rather than per-CPU spin mutexes
for per-CPU data for example).

Reviewed by:	grehan, cognet, arch@, others
Tested on:	i386, alpha, sparc64, powerpc, arm, possibly more
2005-04-04 21:53:56 +00:00
cognet
ecc9baad19 Bring in a version of float.h more correct for softfloat. 2005-03-20 00:34:24 +00:00
cognet
6c9421a55f Bring back some of the cleanups and fixes jmg did in the TS7200 port. 2005-03-17 23:01:15 +00:00
cognet
ca1b2b4bbf Use PCIR_BARS instead of PCIR_MAPS. 2005-03-17 00:43:57 +00:00
cognet
d281593c06 Introduce a new function, pmap_wb_page(), which check all userland mappings for
a given page and, if the pmap is the current pmap, write back the associated
cache line.
Use pmap_wb_page in pmap_qenter() instead of inconditionally
write back/invalidating the data cache.
2005-03-16 23:56:29 +00:00
jmg
a79d14768c MFp4: add in making fiq's work by coping to the correct page incase we have
the vectors relocated high..
2005-03-16 07:56:21 +00:00
jmg
8ce01035fb fix up white space, I had a simple comment fix, but I might as well do the
rest while I'm here...
2005-03-16 07:53:02 +00:00
jmg
452996b575 make bus_dmamem_alloc always allocate a new map like we are suppose to..
This was found when I tried to run the usb code on my arm board...

Approved by:	cognet
2005-03-16 00:35:59 +00:00
jmg
ca28b98b0d fix arm wrt to busdma...
also wrap the two macros that have bare if's w/ do {} while(0) so that
my epe driver doesn't get a warning about braces around confused else...
2005-03-15 14:57:30 +00:00
scottl
ea55d753ff Refactor the bus_dma header files so that the interface is described in
sys/bus_dma.h instead of being copied in every single arch.  This slightly
reorders a flag that was specific to AXP and thus changes the ABI there.
The interface still relies on bus_space definitions found in <machine/bus.h>
so it cannot be included on its own yet, but that will be fixed at a later
date.  Add an MD <machine/bus_dma.h> for ever arch for consistency and to
allow for future MD augmentation of the API.  sparc64 makes heavy use of
this right now due to its different bus_dma implemenation.
2005-03-14 16:46:28 +00:00
mux
425076933c Fixup KTR traces. 2005-03-08 14:49:05 +00:00
mux
f492e8e0d7 Use __func__ in the KTR_BUSDMA traces. This avoids copy and paste
errors like in the bus_dmamap_load_mbuf_sg() case where we were wrongly
displaying the function name as bus_dmamap_load_mbuf.
2005-03-08 11:18:14 +00:00
mux
5833b0e968 Fix typo. 2005-03-07 00:24:52 +00:00
cognet
ddf62ad14c Use [ldr|str]t instead of [ldr|str] when accessing ARM_TP_ADDRESS. 2005-03-06 21:12:03 +00:00
cognet
e1d8c28458 Make sure ARM_TP_ADDRESS is accessible right now by calling pmap_fault_fixup,
as we can't rely on a trap happening, as it is done normally.
While I'm there, uncomment the call to cpu_dcache_wbinv_range() in
pmap_kenter_internal, as we don't call cpu_dcache_wbinv_all() there anymore.
2005-03-06 21:10:31 +00:00
cognet
36e1c6cac0 Unlike NetBSD's bcopy(), our bcopy allows the two strings to overlap, even in
kernel. So bring in the userland version, instead of just calling memcpy.
2005-03-06 13:11:32 +00:00
cognet
e2dc4d653a Handle endianness correctly.
Spotted out by:	jmg
2005-03-03 23:27:09 +00:00
joerg
40a3a9ed33 netchild's mega-patch to isolate compiler dependencies into a central
place.

This moves the dependency on GCC's and other compiler's features into
the central sys/cdefs.h file, while the individual source files can
then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to
refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42.

By now, GCC and ICC (the Intel compiler) have been actively tested on
IA32 platforms by netchild.  Extension to other compilers is supposed
to be possible, of course.

Submitted by:	netchild
Reviewed by:	various developers on arch@, some time ago
2005-03-02 21:33:29 +00:00
cognet
b4e53f01e6 In cpu_throw(), correctly calculate td->td_md.md_tp.
In cpu_switch(), set the DACR even if we're switching to a kernel thread.
2005-03-01 20:51:37 +00:00
cognet
d6c4ddb81e Introduce realmem. 2005-03-01 20:12:52 +00:00
cognet
215f3724e9 Instead of using sysarch() to store-retrieve the tp, add a magic address,
ARM_TP_ADDRESS, where the tp will be stored. On CPUs that support it, a cache
line will be allocated and locked for this address, so that it will never go
to RAM. On CPUs that does not, a page is allocated for it (it will be a bit
slower, and is wrong for SMP, but should be fine for UP).
The tp is still stored in the mdthread struct, and at each context switch,
ARM_TP_ADDRESS gets updated.

Suggested by:   davidxu
2005-02-26 18:59:01 +00:00
cognet
a9cc7c83d3 Add the field in the md part of the struct thread required by ARM_[GET|SET]_TP. 2005-02-26 00:02:14 +00:00
cognet
8b08dd2363 Implement two new sysarch for arm, ARM_GET_TP and ARM_SET_TP, to work around
the lack of tls on arm.
2005-02-25 22:56:16 +00:00
cognet
f1b8c3de78 Make sure casuptr() reset pcb->pcb_onfault when returning. 2005-02-25 22:54:56 +00:00
cognet
81752be77a MFp4: get the code that set the pc correctly to work, remove a few IQ31244
specific mappings from locore.S, re-organize iq31244_machdep.c to work with
the new locore.S

Spotted out by:	jmg
2005-02-20 21:34:59 +00:00
cognet
a4e04310ba Removing the #endif as well sounds like a good idea. 2005-02-20 01:26:01 +00:00
cognet
d9726203cd In cpufunc_control, uncomment the code responsible for returning the old
state of the control register.
2005-02-20 01:24:46 +00:00
ru
b20de64cf4 Use a common multi-inclusion protection, and add such a
protection to alpha/include/exec.h.
2005-02-19 21:16:48 +00:00
cognet
b8a774f3c8 Support high vectors for arm9.
Obtained from:	NetBSD
2005-02-18 17:29:12 +00:00
cognet
c7bd1f8912 Define NIRQ to 64 for CPU_ARM9, because Cirrus Logic EP93XX cores provides
64 irqs.
This should be re-thought later.
2005-02-13 18:26:31 +00:00
cognet
afb68fc98f Remove unused prototype. 2005-02-13 18:20:39 +00:00
cognet
369a407b4e Remove redondant includes. 2005-02-13 18:05:36 +00:00
cognet
198e9d1faf Don't prototype pmap_kenter(). 2005-02-13 17:18:20 +00:00
jmg
bf0aaab69d move pmap.h after vm.h include... some of the headers from pmap.h depend
upon vm.h
2005-02-09 00:10:17 +00:00
njl
c154331727 Finish the job of sorting all includes and fix the build by including
malloc.h before proc.h on sparc64.  Noticed by das@

Compiled on:	alpha, amd64, i386, pc98, sparc64
2005-02-06 01:55:08 +00:00
njl
dc0df86311 Sort includes a little so that bus.h comes before cpu.h (for device_t). 2005-02-04 06:58:09 +00:00
njl
cf050fc4b7 Add an implementation of cpu_est_clockrate(9). This function estimates the
current clock frequency for the given CPU id in units of Hz.
2005-02-04 05:32:56 +00:00