Commit Graph

340 Commits

Author SHA1 Message Date
Olivier Houchard
de76196323 Add support for KTR_BUSDMA. 2005-01-15 19:42:28 +00:00
Olivier Houchard
34c8913825 Add the prototype for bus_dmamap_load_mbuf_sg().
Spotted out by:	scottl
2005-01-15 19:31:08 +00:00
Olivier Houchard
5134102b9d MFi386: add bus_dmamap_load_mbuf_sg(). 2005-01-15 19:07:23 +00:00
Olivier Houchard
6728fc65cc Add the 7 seg display. 2005-01-15 18:55:40 +00:00
Olivier Houchard
4801ad2f3c Add support for the IQ31244 7 seg display.
Obtained from:	NetBSD
2005-01-15 18:55:22 +00:00
Olivier Houchard
7c1658d122 Start the license statement with /*- 2005-01-15 18:38:10 +00:00
Olivier Houchard
70861d0ddd Use device_set_desc(). 2005-01-15 16:57:00 +00:00
Olivier Houchard
d29e12242c Add the i80321 watchdog. 2005-01-15 16:56:22 +00:00
Olivier Houchard
c1729ff0d5 Add a driver for the i80321 watchdog.
Obtained from:		NetBSD
2005-01-15 16:54:35 +00:00
Olivier Houchard
9026d36c6e Add support for ptrace() and gdb breakpoints. 2005-01-10 22:43:16 +00:00
Olivier Houchard
8b64f2f5ad Don't assume pmap_update() will cpwait for us, pmap_update will disappear soon. 2005-01-10 22:41:08 +00:00
Warner Losh
d8315c79d9 Start all license statements with /*- 2005-01-05 21:58:49 +00:00
Alan Cox
1f70d62298 Modify pmap_enter_quick() so that it expects the page queues to be locked
on entry and it assumes the responsibility for releasing the page queues
lock if it must sleep.

Remove a bogus comment from pmap_enter_quick().

Using the first change, modify vm_map_pmap_enter() so that the page queues
lock is acquired and released once, rather than each time that a page
is mapped.
2004-12-23 20:16:11 +00:00
Olivier Houchard
e1e6b9d3c6 - The IQ80321 has a jumper which changes the PCI device id from 4 to 8 for the
GigE controller, so handle this.
- Use the outbound window 0 if the PCI mem requested is in its range, instead
of inconditionally use the outbound window 1.
This should be enough to get FreeBSD/arm to work on the IQ80321 board as well.

Reported and tested by: Jia-Shiun Li <jiashiun at gmail dot com>
2004-12-21 11:36:09 +00:00
Olivier Houchard
885dabe5f7 Update the StrongArm port to match the current code.
- Implement arm_mask_irqs and arm_unmask_irqs
- Provide the available physical address range after pmap_bootstrap allocated
things, instead or before, or bad things happen.
2004-12-18 17:58:49 +00:00
Olivier Houchard
31e3e209b1 Make sure gcc doesn't generate something such as swp r3, r4, [r3] for __swp,
as it has unpredictable results.
2004-12-18 17:43:01 +00:00
Alan Cox
85f5b24573 In the common case, pmap_enter_quick() completes without sleeping.
In such cases, the busying of the page and the unlocking of the
containing object by vm_map_pmap_enter() and vm_fault_prefault() is
unnecessary overhead.  To eliminate this overhead, this change
modifies pmap_enter_quick() so that it expects the object to be locked
on entry and it assumes the responsibility for busying the page and
unlocking the object if it must sleep.  Note: alpha, amd64, i386 and
ia64 are the only implementations optimized by this change; arm,
powerpc, and sparc64 still conservatively busy the page and unlock the
object within every pmap_enter_quick() call.

Additionally, this change is the first case where we synchronize
access to the page's PG_BUSY flag and busy field using the containing
object's lock rather than the global page queues lock.  (Modifications
to the page's PG_BUSY flag and busy field have asserted both locks for
several weeks, enabling an incremental transition.)
2004-12-15 19:55:05 +00:00
Olivier Houchard
44dd466610 Enable interrupts once the active ones have been masked. 2004-12-14 18:57:21 +00:00
Olivier Houchard
353d54aa83 Update the sp after popping the regs.
This is a good candidate for the golden pointy hat awards.
2004-12-14 18:45:05 +00:00
Olivier Houchard
eb64032876 Save a few more cycles in cpu_switch() and cpu_throw(). 2004-12-12 19:21:58 +00:00
Olivier Houchard
cb13ab5bd1 Fix style. 2004-12-11 23:56:03 +00:00
Olivier Houchard
6cf1dd4f37 Add entries to trace syscalls with KTR. 2004-12-11 23:54:03 +00:00
Olivier Houchard
fd4d461166 Fix compilation with INVARIANTS. 2004-12-11 14:46:52 +00:00
Olivier Houchard
84b30e2247 s/RETEQ/RETeq/. 2004-12-10 16:49:08 +00:00
Olivier Houchard
f4427f30f7 Include <sys/signalvar.h> for trapsignal(). 2004-12-07 17:39:42 +00:00
Olivier Houchard
79f40e185d Make sure to map the whole kernel into 1MB pages. Try to use the remaining
memory for things such as the kernel stack.
2004-12-05 22:48:04 +00:00
Olivier Houchard
f4deb15f08 Reactivate the use of the minidata cache. 2004-12-05 22:47:25 +00:00
Olivier Houchard
4090854334 Do not change the page directory and do not flush the TLB when switching to
a kernel thread.
2004-12-05 22:46:59 +00:00
Olivier Houchard
b62e66eb1f Remove an unused field from the struct pv_entry.
While I'm there, fix style.
2004-12-05 22:46:30 +00:00
Olivier Houchard
28ec399c5a Include <sys/signalvar.h> for trapsignal(). 2004-12-02 23:31:48 +00:00
David Schultz
6004362e66 Don't include sys/user.h merely for its side-effect of recursively
including other headers.
2004-11-27 06:51:39 +00:00
Olivier Houchard
a27952c1a9 Enable interrupts as soon as the pending interrupts have been masked. 2004-11-23 16:31:16 +00:00
Olivier Houchard
6054abc495 Use ns8250. 2004-11-23 16:30:50 +00:00
Olivier Houchard
b1ff74ebb3 Cleanup. 2004-11-21 19:41:27 +00:00
Olivier Houchard
7fc1bf0371 Set the frame pointer to 0 in fork_trampoline(). 2004-11-21 19:33:47 +00:00
Olivier Houchard
9ebe15a1d7 Implement breakpoints and single stepping on arm.
Obtained from:	NetBSD
2004-11-21 18:11:39 +00:00
Olivier Houchard
7b90b2998e Remove useless code. 2004-11-20 16:52:30 +00:00
Olivier Houchard
3488a2f7d9 Implement enough to be able to enter and leave DDB. 2004-11-20 16:52:10 +00:00
Olivier Houchard
579d53f4cf Get the kernel stack right now that the u-area is gone. 2004-11-20 16:51:32 +00:00
David Schultz
d305a6da98 Remove UAREA_PAGES and USPACE definitions. The definitions of
USPACE_SVC_STACK_TOP, USPACE_SVC_STACK_BOTTOM, USPACE_UNDEF_STACK_TOP,
and USPACE_UNDEF_STACK_BOTTOM look wrong to me, so I'm leaving them
alone.

Reviewed by:	arch@
2004-11-20 02:31:37 +00:00
David Schultz
837f4b104e Remove some references to U area here while trying not to break
anything.  Someone with ARM hardware could do a lot more to untangle
this code.

Reviewed by:	arch@
2004-11-20 02:31:23 +00:00
David Schultz
6484fde022 Remove references to U area and garbage collect includes.
Reviewed by:	arch@
2004-11-20 02:30:59 +00:00
David Schultz
11111b709f U areas are going away, so don't allocate one for process 0.
Reviewed by:	arch@
2004-11-20 02:29:25 +00:00
Olivier Houchard
a8a2a16a08 Increase cnt.v_syscall and cnt.v_trap when needed. 2004-11-20 00:55:57 +00:00
Olivier Houchard
0e425b6c47 Move KERNPHYSADDR and KERNVIRTADDR from std.i80321 to std.iq31244.
Use the correct KERNPHYSADDR.
2004-11-18 00:05:09 +00:00
Olivier Houchard
826a7f03c5 Simplify a bit bus_dmamap_load_buffer by removing the "first" parameter, use
nseg == -1 instead.

Obtained from:	NetBSD
2004-11-16 00:57:44 +00:00
Olivier Houchard
1101dd6d06 MFi386:
- inlina bus_dmamap_load_buffer
- Directly pass the pmap to bus_dmamap_load_buffer, instead of the struct thread
2004-11-15 23:59:28 +00:00
Olivier Houchard
5918fe42a0 Remove debugging printf. 2004-11-13 15:12:26 +00:00
Olivier Houchard
24c6f4b32a Don't forget to clear the PG_WRITEABLE flag when appropriate. 2004-11-13 14:54:31 +00:00
Olivier Houchard
4c44e1ec63 Use uma_prealloc() on the l2table_zone to prevent a LOR at startup. 2004-11-13 14:41:27 +00:00
Olivier Houchard
8e10380a9f Implement interrupt counting, so that vmstat -i work. 2004-11-12 21:49:05 +00:00
Olivier Houchard
ef7d17237a Don't forget to include opt_vm.h. 2004-11-10 22:11:08 +00:00
Olivier Houchard
9aeab9eabe Convert the IQ31244 code to use ARM32_NEW_VM_LAYOUT. 2004-11-10 22:09:39 +00:00
Olivier Houchard
b599237edb Invalidate the data cache in pmap_qremove() instead of in pmap_kenter(),
and in pmap_enter_quick() instead of pmap_enter().
2004-11-10 21:46:04 +00:00
Tom Rhodes
adcb844412 Remove __P here too.
Ok'ed by:	cognet
2004-11-10 01:33:42 +00:00
Olivier Houchard
2fd21813b0 Use the RET macro. 2004-11-09 16:47:47 +00:00
Olivier Houchard
5f2c6402db Import a RET macro, that will use bx if the arch supports it.
Obtained from:	NetBSD
2004-11-09 16:45:55 +00:00
Alan Cox
d3cb0d99e0 Introduce two new options, "CPU private" and "no wait", to sf_buf_alloc().
Change the spelling of the "catch" option to be consistent with the new
options.  Implement the "no wait" option.  An implementation of the "CPU
private" for i386 will be committed at a later date.
2004-11-08 00:43:46 +00:00
Olivier Houchard
b720bb34f3 Add device mem in config files. 2004-11-07 23:02:15 +00:00
Olivier Houchard
e099742e25 Import md bits for mem(4) on arm.
While I'm there, cleanup a bit pmap.h.
2004-11-07 23:01:36 +00:00
Olivier Houchard
1b135a7e11 Remove useless code. 2004-11-07 16:51:33 +00:00
Olivier Houchard
432f5e3ab9 Disable interrupts for atomic_cmpset_32, this one is just not atomic.
Don't export it to userland.
2004-11-05 23:48:12 +00:00
Olivier Houchard
bd366a3cd4 Copy the syscall args in a tmp variable instead of directly using the
trapframe, as it can be modified in the syscall.
Call thread_user_enter() when appropriate.
2004-11-05 19:57:10 +00:00
Olivier Houchard
8ecf6f65d9 Save a few cycles in context switch.
Update comments to reflect reality.
2004-11-05 19:54:13 +00:00
Olivier Houchard
90f794aaaf If we're still running at the physical address, jump to the virtual address
instead before calling initarm().
This removes the need to map virtual == physical in initarm().
2004-11-05 19:52:55 +00:00
Olivier Houchard
321c47170e Be more verbose about cache capacities. 2004-11-05 19:51:23 +00:00
Olivier Houchard
d20a408be7 Implement casuptr. 2004-11-05 19:50:48 +00:00
Olivier Houchard
1214c18d4e Call pmap_pte_init_arm9 instead of pmap_pte_init_generic if
ARM9_CACHE_WRITE_THROUGH is defined.
2004-11-05 19:48:40 +00:00
Olivier Houchard
bd245b9bd4 In cpu_critical_fork_exit(), make sure to set td_md.md_critnest so that
interrupts will be enabled.

Spotted out by:	jhb
2004-11-05 18:29:45 +00:00
Olivier Houchard
6e91e74e11 Protect the function declarations with #ifdef _KERNEL. 2004-11-04 19:20:54 +00:00
Olivier Houchard
56c6c84155 Directly use __pcpu for PCPU_* instead of pcpup. 2004-11-04 19:19:44 +00:00
Olivier Houchard
27d97a6c49 Decrease KSTACK_PAGES and UAREA_PAGES. 2004-11-04 19:19:21 +00:00
Olivier Houchard
24e01b0c59 Use interrupts_disable() and interrupts_restore() as intr_disable() and
intr_restore() instead of re-implement it.
2004-11-04 19:18:50 +00:00
Olivier Houchard
dba13dd1d3 Don't barf if no CPU type is defined while compiling kernel modules. 2004-11-04 19:16:31 +00:00
Olivier Houchard
3ce6572f9f Implement get_cyclecount(). 2004-11-04 19:15:43 +00:00
Olivier Houchard
a61369085e Try to implement atomic operations using swp, instead of disabling interrupts. 2004-11-04 19:14:50 +00:00
Olivier Houchard
eeaa69102a Use casts to enforce the return type of bswap16() and bswap32(). 2004-11-04 19:07:28 +00:00
Olivier Houchard
4cc4c8f7fe Implement cpu_thread_siginfo() and set_mcontext().
Nuke getframe(), and choose which stack to use directly in sendsig().
2004-11-04 19:04:30 +00:00
Olivier Houchard
b0db6a81d2 Implement cpu_set_upcall and cpu_set_upcall_kse.
Calculate td_frame and td_pcb the right way in cpu_thread_setup.
2004-11-04 18:59:02 +00:00
Olivier Houchard
8d0e9a52c6 Get kernel modules to work. 2004-11-04 18:48:52 +00:00
Andre Oppermann
32672ba88d Reduce annoying SCSI probing delay from 15 to 5 seconds in all GENRIC kernels.
Discussed on:	-current
2004-11-02 20:57:20 +00:00
John Baldwin
d39d4a6e64 - Change the ddb paging "support" to use a variable (db_lines_per_page) to
control the number of lines per page rather than a constant.  The variable
  can be examined and changed in ddb as '$lines'.  Setting the variable to
  0 will effectively turn off paging.
- Change db_putchar() to force out pending whitespace before outputting
  newlines and carriage returns so that one can rub out content on the
  current line via '\r     \r' type strings.
- Change the simple pager to rub out the --More-- prompt explicitly when
  the routine exits.
- Add some aliases to the simple pager to make it more compatible with
  more(1): 'e' and 'j' do a single line.  'd' does half a page, and
  'f' does a full page.

MFC after:	1 month
Inspired by:	kris
2004-11-01 22:15:15 +00:00
Olivier Houchard
99cf590376 We want to ignore BUS_DMASYNC_POSTWRITE, not BUS_DMASYNC_POSTREAD.
Spotted out by:	mux
Pointy hat to:	cognet
2004-10-21 11:59:33 +00:00
Olivier Houchard
9c2ac80375 Use a default MD_ROOT_SIZE of 65535. 2004-10-11 14:42:06 +00:00
Olivier Houchard
ed4dc69883 Use MD_ROOT_SIZE, instead of our own macro. 2004-10-11 14:41:38 +00:00
Olivier Houchard
74e9b5ed3b Add optimized version of the bswap macroes for constants if __OPTIMIZED__ is
defined.
2004-10-01 16:55:59 +00:00
Olivier Houchard
d60ea0a816 There's no need to turn on MALLOC_PROFILE by default. 2004-10-01 16:51:37 +00:00
Olivier Houchard
77ee40aac5 Calling fuword from fuword32 with bl and without returning after is really a bad
idea.
Any way I get a customized CVS template with "Pointy hat to:	cognet"
pre-filled ?
2004-09-28 14:39:26 +00:00
Olivier Houchard
022fb84224 Always invalidate the whole data cache in pmap_enter() for now.
It should not be needed.
2004-09-28 14:38:14 +00:00
Olivier Houchard
e462e1ba03 Remove dead code. 2004-09-28 14:37:39 +00:00
Olivier Houchard
4b7d15c6dc Add the config file for the IQ31244 board. 2004-09-23 22:55:00 +00:00
Olivier Houchard
f67baa4d6b Use the new KERNVIRTADDR and PHYSADDR options.
Add KDB.
2004-09-23 22:53:50 +00:00
Olivier Houchard
6052fa47a9 Import partial support for the IQ31244 eval board (i80321 CPU). IQ80321 might
work out of the box too, but I have no hardware to test.
It works well enough to go multiuser. Network works, SATA does not, as I have
no drive to test.
Thanks to Intel for sending such a board.

Obtained from:  NetBSD
2004-09-23 22:45:36 +00:00
Olivier Houchard
3ce77c124e Add Xscale common headers. 2004-09-23 22:36:13 +00:00
Olivier Houchard
906ce37658 Big cleanup: get ride of the whole spl level logic, as FreeBSD doesn't use
it anymore.
2004-09-23 22:33:38 +00:00
Olivier Houchard
8413603da8 Now that we have pmap_growkernel(), use more KVA. 2004-09-23 22:32:33 +00:00
Olivier Houchard
1f5f31b4ec Remove the empty definition of struct osigcontext, as it will never be used. 2004-09-23 22:31:49 +00:00
Olivier Houchard
7ea7271711 Remove the pcb32_cstate field of struct pcb. 2004-09-23 22:31:08 +00:00
Olivier Houchard
f04d49ad11 Declare sigcode and szsigcode. 2004-09-23 22:30:05 +00:00
Olivier Houchard
9f0f6bf453 Define VM_PROT_READ_IS_EXEC. 2004-09-23 22:29:43 +00:00
Olivier Houchard
ffa589bf15 Implement _mcount().
Obtained from:	NetBSD
2004-09-23 22:29:18 +00:00
Olivier Houchard
c038ee8196 Define STACKALIGNBYTES and STACKALIGN. 2004-09-23 22:27:42 +00:00
Olivier Houchard
a40d2bb653 We are using _mcount, not __mcount.
Remove the !__ELF__ case.
2004-09-23 22:26:29 +00:00
Olivier Houchard
8476fd9ff7 Use sf_bufs for uiomove_fromphys(). 2004-09-23 22:25:20 +00:00
Olivier Houchard
04aebdab36 On Xscale, use the minicache for the kernel stack. 2004-09-23 22:24:12 +00:00
Olivier Houchard
9979f39280 Make sure to call cred_update_thread() if needed.
Add partial support for KTRACE.
2004-09-23 22:22:33 +00:00
Olivier Houchard
8be9ab9730 Implement cpu_throw().
Obtained from:	NetBSD
2004-09-23 22:20:59 +00:00
Olivier Houchard
01997784aa Remove unused macroes.
Add user, btrap, etrap, bintr and eintrt in the GPROF case.
2004-09-23 22:18:56 +00:00
Olivier Houchard
0627741cbf Implement sigreturn(). 2004-09-23 22:12:28 +00:00
Olivier Houchard
f0c85e996a Add the hw.machine sysctl. 2004-09-23 22:11:43 +00:00
Olivier Houchard
a7e3e43349 Remove definitions related to the pmap cache state, and add TDF_NEEDRESCHED. 2004-09-23 22:11:06 +00:00
Olivier Houchard
7c320e5bfb Add new functions to know which irqs are pending, and to mask and unmask
interrupts, as these are CPU specific.
If the interrupt handler is not marked as INTR_FAST, don't unmask the
interrupt until it as been serviced.
2004-09-23 22:09:57 +00:00
Olivier Houchard
1e82631893 Rename macroes, as we don't need to mess with alignment faults.
Call ast() if TDF_NEEDRESCHED is set too, not just TDF_ASTPENDING.
2004-09-23 22:05:40 +00:00
Olivier Houchard
289d61042d Use sigcode. 2004-09-23 22:03:25 +00:00
Olivier Houchard
282c3a6588 In db_stack_trace_cmd, remove the "pc" variable, we don't need it. 2004-09-23 22:02:59 +00:00
Olivier Houchard
3f0cbe0ef6 Use the right path for xscale files. 2004-09-23 21:59:43 +00:00
Olivier Houchard
a5bb1c8501 Remove bus_space_vaddr(), it does not exists in FreeBSD. 2004-09-23 21:59:14 +00:00
Olivier Houchard
4637f47217 Don't attempt to manage our own segment list, and just remember the buffers
provided.

Obtained from:	NetBSD
2004-09-23 21:57:47 +00:00
Olivier Houchard
f68fab42ef Use the right path for the bcopyinout_xscale.S file. 2004-09-23 21:56:36 +00:00
Olivier Houchard
371853e562 Add MD syscalls to sync the icache and to drain the write buffer.
Obtained from:	NetBSD
2004-09-23 21:56:01 +00:00
Olivier Houchard
8e90166a08 Implement pmap_growkernel() and pmap_extract_and_hold().
Remove the cache state logic : right now, it provides more problems than it
helps.
Add helper functions for mapping devices while bootstrapping.
Reorganize the code a bit, and remove dead code.

Obtained from:	NetBSD (partially)
2004-09-23 21:54:25 +00:00
Olivier Houchard
6f358f0045 Map the kernel very early if needed.
Implement sigcode.
2004-09-23 21:49:10 +00:00
John Baldwin
76764432e4 - Add support for "paging" in stack trace output. That is, when you do
a stack trace from ddb, the output will pause with a '--More--' prompt
  every 18 lines.  If you hit Enter, it will print another line and prompt
  again.  If you hit space it will output another page and then prompt.
  If you hit 'q' or 'x' it will abort the rest of the stack trace.
- Fix the sparc64 userland stack trace to honor the total count of lines
  to print.  This is useful if your trace happens to walk back onto
  0xdeadc0de and gets stuck in an endless loop.

MFC after:	1 month
Tested on:	i386, alpha, sparc64
2004-09-20 19:05:32 +00:00
Scott Long
50736a153b Fix a problem with tag->boundary inheritence that has existed since day one
and was propagated to nearly every platform.  The boundary of the child needs
to consider the boundary of the parent and pick the minimum of the two, not
the maximum.  However, if either is 0 then pick the appropriate one.
This bug was exposed by a recent change to ATA, which should now be fixed by
this change.  The alignment and maxsegsz tag attributes likely also need
a similar review in the near future.

This is a MT5 candidate.

Reviewed by: marcel
Submitted by: sos (in part)
2004-09-08 04:54:19 +00:00
Julian Elischer
ed062c8d66 Refactor a bunch of scheduler code to give basically the same behaviour
but with slightly cleaned up interfaces.

The KSE structure has become the same as the "per thread scheduler
private data" structure. In order to not make the diffs too great
one is #defined as the other at this time.

The KSE (or td_sched) structure is  now allocated per thread and has no
allocation code of its own.

Concurrency for a KSEGRP is now kept track of via a simple pair of counters
rather than using KSE structures as tokens.

Since the KSE structure is different in each scheduler, kern_switch.c
is now included at the end of each scheduler. Nothing outside the
scheduler knows the contents of the KSE (aka td_sched) structure.

The fields in the ksegrp structure that are to do with the scheduler's
queueing mechanisms are now moved to the kg_sched structure.
(per ksegrp scheduler private data structure). In other words how the
scheduler queues and keeps track of threads is no-one's business except
the scheduler's. This should allow people to write experimental
schedulers with completely different internal structuring.

A scheduler call sched_set_concurrency(kg, N) has been added that
notifies teh scheduler that no more than N threads from that ksegrp
should be allowed to be on concurrently scheduled. This is also
used to enforce 'fainess' at this time so that a ksegrp with
10000 threads can not swamp a the run queue and force out a process
with 1 thread, since the current code will not set the concurrency above
NCPU, and both schedulers will not allow more than that many
onto the system run queue at a time. Each scheduler should eventualy develop
their own methods to do this now that they are effectively separated.

Rejig libthr's kernel interface to follow the same code paths as
linkse for scope system threads. This has slightly hurt libthr's performance
but I will work to recover as much of it as I can.

Thread exit code has been cleaned up greatly.
exit and exec code now transitions a process back to
'standard non-threaded mode' before taking the next step.
Reviewed by:	scottl, peter
MFC after:	1 week
2004-09-05 02:09:54 +00:00
Marcel Moolenaar
0f2fe153bc Move the kernel-specific logic to adjust frompc from MI to MD. For
these two reasons:
1. On ia64 a function pointer does not hold the address of the first
   instruction of a functions implementation. It holds the address
   of a function descriptor. Hence the user(), btrap(), eintr() and
   bintr() prototypes are wrong for getting the actual code address.
2. The logic forces interrupt, trap and exception entry points to
   be layed-out contiguously. This can not be achieved on ia64 and is
   generally just bad programming.

The MCOUNT_FROMPC_USER macro is used to set the frompc argument to
some kernel address which represents any frompc that falls outside
the kernel text range. The macro can expand to ~0U to bail out in
that case.
The MCOUNT_FROMPC_INTR macro is used to set the frompc argument to
some kernel address to represent a call to a trap or interrupt
handler. This to avoid that the trap or interrupt handler appear to
be called from everywhere in the call graph. The macro can expand
to ~0U to prevent adjusting frompc. Note that the argument is selfpc,
not frompc.

This commit defines the macros on all architectures equivalently to
the original code in sys/libkern/mcount.c. People can take it from
here...

Compile-tested on: alpha, amd64, i386, ia64 and sparc64
Boot-tested on: i386
2004-08-27 19:42:35 +00:00
Marcel Moolenaar
4da47b2fec Add __elfN(dump_thread). This function is called from __elfN(coredump)
to allow dumping per-thread machine specific notes. On ia64 we use this
function to flush the dirty registers onto the backingstore before we
write out the PRSTATUS notes.

Tested on: alpha, amd64, i386, ia64 & sparc64
Not tested on: arm, powerpc
2004-08-11 02:35:06 +00:00
Alan Cox
6306df6b89 Add a comment describing pmap_extract_and_hold() noting that the protection
check still needs implementation on arm.
2004-08-10 21:43:40 +00:00
Olivier Houchard
0f1f0c5d75 Use the new prototype for the zone constructor. 2004-08-06 22:32:53 +00:00
Alan Cox
684a62b7bf - Push down the acquisition and release of Giant into pmap_enter_quick()
on those architectures without pmap locking.
 - Eliminate the acquisition and release of Giant in vm_map_pmap_enter().
2004-08-04 22:03:16 +00:00
Maxime Henrion
9f1b87f106 Instead of calling ia32_pause() conditionally on __i386__ or __amd64__
being defined, define and use a new MD macro, cpu_spinwait().  It only
expands to something on i386 and amd64, so the compiled code should be
identical.

Name of the macro found by:	jhb
Reviewed by:	jhb
2004-08-03 18:44:27 +00:00
Olivier Houchard
9b60f79d2a *blush*
Fix htonl and htons.
2004-08-02 12:24:18 +00:00
Olivier Houchard
5b17d1f95a Fix comments.
Spotted out by:	mux
2004-08-02 12:23:53 +00:00
Alan Cox
9bb0e06861 - Push down the acquisition and release of Giant into pmap_protect() on
those architectures without pmap locking.
 - Eliminate the acquisition and release of Giant from vm_map_protect().

(Translation: mprotect(2) runs to completion without touching Giant on
alpha, amd64, i386 and ia64.)
2004-07-30 20:38:30 +00:00
Olivier Houchard
32494fa097 Don't use cast as lvalue. 2004-07-29 12:33:54 +00:00
Robert Watson
76e8a01fc9 Correct typo in prior commit: s/cd/td/ 2004-07-27 19:44:08 +00:00
Robert Watson
1a8cfbc450 Pass a thread argument into cpu_critical_{enter,exit}() rather than
dereference curthread.  It is called only from critical_{enter,exit}(),
which already dereferences curthread.  This doesn't seem to affect SMP
performance in my benchmarks, but improves MySQL transaction throughput
by about 1% on UP on my Xeon.

Head nodding:	jhb, bmilekic
2004-07-27 16:41:01 +00:00
Alan Cox
0cfc058a42 MFi386 revision 1.421
- Use kmem_alloc_nofault() rather than kmem_alloc_pageable() in
   pmap_mapdev().  See revision 1.140 of kern/sys_pipe.c for a detailed
   rationale.
2004-07-22 23:04:41 +00:00
Olivier Houchard
c5f7772fe7 Do not declare curpcb. 2004-07-21 22:04:32 +00:00
Olivier Houchard
dd561b973b Use the kernel pmap if no thread is provided. 2004-07-21 22:04:05 +00:00
Olivier Houchard
6933f3a5ca Define pmap_page_is_mapped(). 2004-07-21 22:02:48 +00:00
Olivier Houchard
73f2212997 Do not use NULL as a malloc type for contigmalloc(). 2004-07-21 15:18:45 +00:00
Marcel Moolenaar
fd32d93b97 Unify db_stack_trace_cmd(). All it did was look up the thread given
the thread ID and call db_trace_thread().
Since arm has all the logic in db_stack_trace_cmd(), rename the
new DB_COMMAND function to db_stack_trace to avoid conflicts on
arm.
While here, have db_stack_trace parse its own arguments so that
we can use a more natural radix for IDs. If the ID is not a thread
ID, or more precisely when no thread exists with the ID, try if
there's a process with that ID and return the first thread in it.
This makes it easier to print stack traces from the ps output.

requested by: rwatson@
tested on: amd64, i386, ia64
2004-07-21 05:07:09 +00:00
Olivier Houchard
f15c92cfe3 Implement ptrace_set_pc().
Add a stub for ptrace_clear_single_step().
2004-07-20 23:00:02 +00:00
Olivier Houchard
7e477511d8 Remove astpending, it has not been used for a long time. 2004-07-20 22:39:56 +00:00
Olivier Houchard
8db19c62a4 Uncomment the vector relocation code. 2004-07-20 22:39:24 +00:00
Olivier Houchard
be687a0dda Nuke disable_intr() and enable_intr(), as it already exists elsewhere. 2004-07-20 22:38:46 +00:00
Olivier Houchard
9cdb2bfc90 Make kdb_backtrace() sort of work. 2004-07-19 12:26:44 +00:00
David Schultz
479f8d2214 Make FLT_ROUNDS correctly reflect the dynamic rounding mode. 2004-07-19 08:17:25 +00:00
Olivier Houchard
8908521788 In pmap_remove_pages(), when the pv_list is entry, we want to clean the
PG_WRITEABLE flag, not the PG_REFERENCED flag.

Submitted by:   alc
2004-07-13 22:40:59 +00:00