Commit Graph

382 Commits

Author SHA1 Message Date
obrien
7af4f5af38 Add .cvsignore files just like in sys/<arch>/compiled, this keeps CVS from
questing kernel config files not in CVS.

Approved by:	re(kensmith)
2005-06-20 16:52:59 +00:00
cognet
79dda5190c Try harder to detect if the allocated memory for L2 PTP comes from a 1MB
section or not.

Approved by:	re (blanket)
2005-06-16 13:23:39 +00:00
cognet
6a3b6acd65 Don't pass the kernel_pmap to pmap_fault_fixup() if the fault comes from
kernel mode, always use the curthread pmap instead. There are valid cases
were we can fault on a user address from the kernel without pcb_onfault
being set.

Approved by:	re (blanket)
2005-06-16 13:21:52 +00:00
cognet
4bd70d8bca Remove the last use of pmap_initialized. 2005-06-10 13:31:30 +00:00
alc
2d109601cb Introduce a procedure, pmap_page_init(), that initializes the
vm_page's machine-dependent fields.  Use this function in
vm_pageq_add_new_page() so that the vm_page's machine-dependent and
machine-independent fields are initialized at the same time.

Remove code from pmap_init() for initializing the vm_page's
machine-dependent fields.

Remove stale comments from pmap_init().

Eliminate the Boolean variable pmap_initialized from the alpha, amd64,
i386, and ia64 pmap implementations.  Its use is no longer required
because of the above changes and earlier changes that result in physical
memory that is being mapped at initialization time being mapped without
pv entries.

Tested by: cognet, kensmith, marcel
2005-06-10 03:33:36 +00:00
jkoshy
1d3209ab83 MFP4:
- Implement sampling modes and logging support in hwpmc(4).

- Separate MI and MD parts of hwpmc(4) and allow sharing of
  PMC implementations across different architectures.
  Add support for P4 (EMT64) style PMCs to the amd64 code.

- New pmcstat(8) options: -E (exit time counts) -W (counts
  every context switch), -R (print log file).

- pmc(3) API changes, improve our ability to keep ABI compatibility
  in the future.  Add more 'alias' names for commonly used events.

- bug fixes & documentation.
2005-06-09 19:45:09 +00:00
cognet
1485792736 Use tabs, not spaces.
Reported by:	ru
2005-06-09 15:05:09 +00:00
cognet
9f2fa9c999 Add ata stuff. 2005-06-09 12:32:15 +00:00
cognet
cbb8d627a3 - MFp4: modify slightly the arm intr API, there's arm CPUs with more than 32
interrupts.
- Implement teardown methods where appropriate.
2005-06-09 12:26:20 +00:00
cognet
ee6e2d90e2 Add a new arm-specific option, ARM_USE_SMALL_ALLOC. If defined, it provides
an implementation of uma_small_alloc() which tries to preallocate memory
1MB per 1MB, and maps it into a section mapping.
2005-06-07 23:04:24 +00:00
cognet
70eb7340ea Bring in bits I forgot while importing write back support for arm9. 2005-06-03 19:49:53 +00:00
cognet
8adc242211 Remove a useless printf. 2005-06-03 15:15:26 +00:00
marcel
bb14b518f7 Create nexus in configure_first() instead of in configure(). This
makes sure that sysinit tasks that run after configure_first(),
but before configure() have a nexus to hang devices off.
2005-05-29 23:44:22 +00:00
marcel
0fc00302ea Call cninit_finish() and set cold to 0 in configure_final() instead
of in configure(). Call cninit_finish() before setting cold to 0.
This is how it's done for other platforms. Be alike to avoid problems.
2005-05-29 22:45:36 +00:00
nyan
0fce92f5c4 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
cognet
595ee93a51 Remove pmap_deactivate(), we do not use it. 2005-05-27 00:45:39 +00:00
cognet
be7058be25 s/_KLD_MODULE/KLD_MODULE/ 2005-05-26 16:05:22 +00:00
cognet
f010830f2e Don't enable interrupts in the dispatcher, there's no need to do so. 2005-05-26 15:02:47 +00:00
cognet
3d22dfba08 Don't call vm_page_dirty() in pmap_nuke_pv(), it's not the place to do so, and
it leads to funny things, such as pmap_remove_all() marking the page as dirty.
2005-05-26 15:01:13 +00:00
cognet
3aa321bbac Remove bits specific to CPUs we won't support (< armv4). 2005-05-25 13:46:32 +00:00
cognet
85c2eb1c3f Increase the refresh rate. 2005-05-25 13:44:55 +00:00
cognet
4bb31d78c7 MFp4: Setup arm9 to write back by default.
Obtained from:	NetBSD
2005-05-24 23:57:22 +00:00
cognet
d2691df07d Remove kcopy(), we don't use it. 2005-05-24 23:55:09 +00:00
cognet
71c388ce21 We need to decrease p->p_lock after vm_fault() has been called. 2005-05-24 23:06:02 +00:00
cognet
d1e353d08b Correctly setup the UND stack in cpu_set_upcall(), and the trapframe in
cpu_thread_setup(), as done in cpu_fork().
2005-05-24 23:05:26 +00:00
cognet
c29fa0b7e5 - Try to avoid calling malloc() in bus_dmamap_create() and bus_dmamem_alloc()
for the dmamap by using static dmamaps.
- Don't do anything for BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTWRITE in
bus_dmamap_sync(), it's not needed anymore.
2005-05-24 22:10:35 +00:00
cognet
734781d7b2 Write back affected pages in pmap_qremove() as well. This removes the need
to change the DACR when switching to a kernel thread, thus making
userland thread => kernel thread => same userland thread switch cheaper by
totally avoiding data cache and TLB invalidation.
2005-05-24 21:47:10 +00:00
cognet
98e12d6f01 Use a more sane value for HZ. 2005-05-24 21:45:26 +00:00
cognet
f58c9faa71 Use asm versions of in_cksum() and friends. 2005-05-24 21:44:34 +00:00
cognet
6f02d3277d Asm version of bswap16().
Obtained from: 	NetBSD
2005-05-24 21:43:16 +00:00
cognet
7001627d7d Make sure we clean the RAS start address once we're done.
This fixes the random segfaults which occurs at high interrupts rate.
2005-05-24 21:42:31 +00:00
cognet
b2be2c6b08 Don't forget to copy the TP when forking, or bad things will happen to the
child process if it tries to use threads.
2005-05-11 21:20:42 +00:00
cognet
271aaadf53 Allocating the memory for the kernel stack one time is enough. 2005-04-27 13:29:54 +00:00
cognet
2d0fba3d59 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
2155a04472 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
4dd49b3b66 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
b1662f9d0f 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
6d9e17ad63 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
3df6c3c176 pmap_update() is gone. 2005-04-13 16:02:03 +00:00
jhb
f9da7305b5 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
c2900a7a3b We have an asm version of bcmp(), so we could use it as well. 2005-04-12 22:46:09 +00:00
cognet
0d26b3b262 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
32d01fd075 pmap_update() is gone. 2005-04-07 22:03:34 +00:00
cognet
64c6be3ab3 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
0eff5864a9 - Try harder to report dirty page.
- Garbage-collect pmap_update(), it became quite useless.
2005-04-07 22:01:53 +00:00
jhb
41cadaa11e 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
f6962ae479 Bring in a version of float.h more correct for softfloat. 2005-03-20 00:34:24 +00:00
cognet
d8999c1cc6 Bring back some of the cleanups and fixes jmg did in the TS7200 port. 2005-03-17 23:01:15 +00:00
cognet
6734525d63 Use PCIR_BARS instead of PCIR_MAPS. 2005-03-17 00:43:57 +00:00
cognet
860ca4946f 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
0ef117a450 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
40dbd0165c 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
fdf23f69c0 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
c3d17f2e03 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
7be505a035 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
b5abf2d5ef Fixup KTR traces. 2005-03-08 14:49:05 +00:00
mux
7cf99970a7 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
7c1c0975e6 Fix typo. 2005-03-07 00:24:52 +00:00
cognet
1bc82499df Use [ldr|str]t instead of [ldr|str] when accessing ARM_TP_ADDRESS. 2005-03-06 21:12:03 +00:00
cognet
5e08d267b5 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
d058ee9a99 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
e5ec1f72f1 Handle endianness correctly.
Spotted out by:	jmg
2005-03-03 23:27:09 +00:00
joerg
c85a3e95f7 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
42a8b3a567 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
1491adb10b Introduce realmem. 2005-03-01 20:12:52 +00:00
cognet
43586d701a 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
ea8a18c379 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
3aab487108 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
5b6d27e25b Make sure casuptr() reset pcb->pcb_onfault when returning. 2005-02-25 22:54:56 +00:00
cognet
e3c78fa692 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
2b4c5432b2 Removing the #endif as well sounds like a good idea. 2005-02-20 01:26:01 +00:00
cognet
66e4db6966 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
6cc6926066 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
eebf9afbba Support high vectors for arm9.
Obtained from:	NetBSD
2005-02-18 17:29:12 +00:00
cognet
19a07769b7 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
60d70ae863 Remove unused prototype. 2005-02-13 18:20:39 +00:00
cognet
e8d555022d Remove redondant includes. 2005-02-13 18:05:36 +00:00
cognet
8466ce70d6 Don't prototype pmap_kenter(). 2005-02-13 17:18:20 +00:00
jmg
e9d4e6750b 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
2958530007 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
cd2bcf063b Sort includes a little so that bus.h comes before cpu.h (for device_t). 2005-02-04 06:58:09 +00:00
njl
54a88fdbee 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
njl
2579b2e0bf Sort functions. 2005-02-01 06:36:27 +00:00
cognet
5638709391 Make sure we can boot both with and without MMU enabled. 2005-01-23 22:08:31 +00:00
cognet
fe5f83713c Define bus_dmamap_load_buffer before bus_dmamap_load to make gcc happy. 2005-01-23 22:07:33 +00:00
cognet
37230f7c69 Fix compile for !KTR. 2005-01-23 21:39:23 +00:00
cognet
28e246b289 Remove references to non-existing symbols DO_corb and got_mmu.
While I'm there, remove dead code.
2005-01-20 22:23:26 +00:00
cognet
2a66290389 Fix compile for __ARMEB__. 2005-01-19 16:22:20 +00:00
cognet
5608e326b2 MFpowerpc: Work around the problem of returning a 32 bits value from
__syscall() on a 32 bits big-endian arch.

Spotted out by:	grehan
2005-01-19 00:37:03 +00:00
cognet
ab7ed627f8 Start to support the big endian case as well. 2005-01-18 15:51:50 +00:00
cognet
5dcea2459e Add a new sysctl, hw.sevenseg.freq, to control the update frequency. 2005-01-16 13:18:52 +00:00
cognet
3f738b3942 Erm, don't forget to store the mbuf in the dmamap in bus_dmamap_load_mbuf_sg(),
so that bus_dmamap_sync() knows what to invalidate. This makes em(4) work again.
While I'm there, remove the unused "first" variable.
2005-01-16 13:15:16 +00:00
cognet
7c9c98e639 Add support for KTR_BUSDMA. 2005-01-15 19:42:28 +00:00
cognet
897fdcefd3 Add the prototype for bus_dmamap_load_mbuf_sg().
Spotted out by:	scottl
2005-01-15 19:31:08 +00:00
cognet
072c519386 MFi386: add bus_dmamap_load_mbuf_sg(). 2005-01-15 19:07:23 +00:00
cognet
5435311167 Add the 7 seg display. 2005-01-15 18:55:40 +00:00
cognet
6365349c89 Add support for the IQ31244 7 seg display.
Obtained from:	NetBSD
2005-01-15 18:55:22 +00:00
cognet
4955cf8c26 Start the license statement with /*- 2005-01-15 18:38:10 +00:00
cognet
4251591c3f Use device_set_desc(). 2005-01-15 16:57:00 +00:00
cognet
f34de841db Add the i80321 watchdog. 2005-01-15 16:56:22 +00:00