Commit Graph

453 Commits

Author SHA1 Message Date
dfr
6826b0f638 Teach DDB about branch registers. 2001-11-09 13:08:25 +00:00
dfr
55804bb99b Define PS and VE fields of region register correctly. 2001-11-09 13:07:44 +00:00
marcel
2b7499de1c Implement os_boot_rendez. Application processors are initialized
and brought to a point where kernel specific initializations can
be done. That will be the next step...
2001-11-09 05:18:45 +00:00
marcel
f43c59c885 Don't pass os_boot_rendez directly to SAL_SET_VECTORS, because it's
actually the address of the function descriptor. The fdesc has both
the address of the function and it's corresponding gp value. Now
that we have a gp value, use it instead of passing 0.
2001-11-05 05:55:33 +00:00
dfr
4d986e064d Implement <machine/ieeefp.h> 2001-11-03 15:51:14 +00:00
dillon
206c5d779e Implement i386/i386/pmap.c 1.292 for alpha, ia64 (avoid free
page exhaustion / kernel panic for certain madvise() scenarios)
2001-11-03 01:08:55 +00:00
mike
3df91ed4db o Add new header <sys/stdint.h>.
o Make <stdint.h> a symbolic link to <sys/stdint.h>.
o Move most of <sys/inttypes.h> into <sys/stdint.h>, as per C99.
o Remove <sys/inttypes.h>.
o Adjust includes in sys/types.h and boot/efi/include/ia64/efibind.h
  to reflect new location of integer types in <sys/stdint.h>.
o Remove previously symbolicly linked <inttypes.h>, instead create a
  new file.
o Add MD headers <machine/_inttypes.h> from NetBSD.
o Include <sys/stdint.h> in <inttypes.h>, as required by C99; and
  include <machine/_inttypes.h> in <inttypes.h>, to fill in the
  remaining requirements for <inttypes.h>.
o Add additional integer types in <machine/ansi.h> and
  <machine/limits.h> which are included via <sys/stdint.h>.

Partially obtain from:	NetBSD
Tested on:		alpha, i386
Discussed on:		freebsd-standards@bostonradio.org
Reviewed by:		bde, fenner, obrien, wollman
2001-11-02 18:05:43 +00:00
dfr
71aecf4a81 Call ast() from exception_restore when we are restoring to user mode. 2001-11-02 10:24:44 +00:00
dfr
7438cac08a Use static storage for the unwind state so that we can still get backtraces
when the VM system is hosed.
2001-11-02 10:04:22 +00:00
dfr
b4e7f2c409 Remember to actually free the pv_entry in pmap_remove_entry(). 2001-11-02 08:56:58 +00:00
peter
0880a68a98 argh! cut/paste typo. :-(
(committed on a different machine to what I was testing it on)
2001-11-02 01:45:11 +00:00
peter
81577a9eef "Fix" a problem that got copied from alpha to ia64 and broke there.
When we truncate the msgbuf size because the last chunk is too small,
correctly terminate the phys_avail[] array - the VM system tests
the *end* for zero, not the start.  This leads the VM startup to
attempt to recreate a duplicate set of pages for all physical memory.

XXX the msgbuf handling is suspiciously different on i386 vs
alpha/ia64...
2001-11-02 00:41:00 +00:00
dfr
f51909e7f5 Experiment with rewriting the syscall() wrapper using explicit bundling
and trying to reduce stalls from reading certain high latency registers.
This should be faster than the old syscall code. Its certainly a lot
smaller.
2001-10-31 20:02:28 +00:00
dfr
6baefe805c Add TF_AR_FPSR, the offset of ar.fpsr in a trapframe. 2001-10-31 18:06:38 +00:00
dfr
e01059ed52 Print the bundle template name on the first slot of the bundle. 2001-10-31 11:52:29 +00:00
dfr
19a2ddc6e3 * Factor out common code for manipulating the RSE backing store.
* Implement a fairly simplistic parser for unwinding stack frames.
* Use unwind records for DDB's 'trace' command. Also add support for
  tracing past exceptions to the context which generated the exception.

The stack unwind code requires a toolchain based on binutils-2.11.2 or
later and gcc-3.0.1 or later.
2001-10-29 12:04:23 +00:00
dfr
53c1fbf106 Make the various bits of SMP code conditional on SMP so that I can still
build non-SMP kernels.
2001-10-29 11:57:12 +00:00
dfr
09a1f139c4 Various fixes to make stack traces using the unwind tables work properly. 2001-10-29 11:30:54 +00:00
dfr
439a7ddc5f Fix disassembly of 'add a=b,c,1' and make the disassembly of the various
break and nops consistent.
2001-10-29 11:26:10 +00:00
peter
d03e3b56fc The size of the ELF hash table changed from 64 bits in the prototype
toolchains to 32 bits in 2.11.2.

Obtained from:	dfr
2001-10-29 10:20:19 +00:00
marcel
2a8a0474b8 o Send a test IPI from the BSP to itself at the same time APs
are woken up.
o  Make IPIs synchronuous by default. If we want asynchronuous
   IPIs, we may want to make the memory fence controllable.
2001-10-29 07:34:48 +00:00
marcel
f735e80481 Add an IPI used for testing proper operation of delivering IPIs. 2001-10-29 07:30:37 +00:00
marcel
a98296919f Make the clock vector 255 instead of 240. On Lion boxes, 240 is
the AP wake-up vector. We probably want a more dynamic approach
to assigning vectors in the future...
2001-10-29 05:17:36 +00:00
marcel
5a7378a40b Small correction in the LOCAL_SAPIC structure. The Flags field
starts at offset 8; not 6. Hence the structure is 12 bytes and
not 10 bytes. Adjust the definition so that the ProcessorEnabled
flag is moved from bit 15 to bit 31 in the Flags field.

The definition now matches ACPI 2.0 Errata 1.5.
2001-10-29 04:59:35 +00:00
marcel
830dbf12d9 o Do not parse the MADT as a side-effect in AcpiOsGetRootPointer,
do it as a side-effect of probing for MP hardware. This allows
   us to scan for local SAPICs early (especially before MBUF
   initialization).
o  Fix the Local SAPIC structure so that matches the Local SAPIC
   table entry. Now that the Local SAPIC info is the same as the
   Local APIC info, stop dumping the Local APIC entries.
o  For every Local SAPIC entry in the MADT that's not disabled,
   let the SMP code know about it. They represent actual CPUs.
o  Register the OS_BOOT_RENDEZ entry point and provide a (bogus)
   implementation for the entry point.
o  Provide a mapping for internal IPI numbers to ExtINT vectors.
o  In a MP system, announce the CPUs and start them by sending
   IPI_AP_WAKEUP to each of them. Not that it makes a difference
   at this time :-)
o  Miscellaneous style fixes and other adjustments.
2001-10-29 02:16:02 +00:00
iwasaki
1b24a8aa4e Add APM compatibility feature to ACPI.
This emulates APM device node interface APIs (mainly ioctl) and
provides APM services for the applications.  The goal is to support
most of APM applications without any changes.
Implemented ioctls in this commit are:
 - APMIO_SUSPEND (mapped ACPI S3 as default but changable by sysctl)
 - APMIO_STANDBY (mapped ACPI S1 as default but changable by sysctl)
 - APMIO_GETINFO and APMIO_GETINFO_OLD
 - APMIO_GETPWSTATUS

With above, many APM applications which get batteries, ac-line
info. and transition the system into suspend/standby mode (such as
wmapm, xbatt) should work with ACPI enabled kernel (if ACPI works well :-)

Reviewed by:	arch@, audit@ and some guys
2001-10-26 17:43:05 +00:00
jhb
46e3f92a5d Add a per-thread ucred reference for syscalls and synchronous traps from
userland.  The per thread ucred reference is immutable and thus needs no
locks to be read.  However, until all the proc locking associated with
writes to p_ucred are completed, it is still not safe to use the per-thread
reference.

Tested on:	x86 (SMP), alpha, sparc64
2001-10-26 08:12:54 +00:00
dfr
aa73531f83 * Clear the TLB on boot.
* If a pte for a location given to pmap_enter_quick is valid, just give
  up - don't panic, even if the mapping is different.
2001-10-24 21:22:08 +00:00
dfr
c0bfb6b8ea If we get an unhandled page fault in kernel mode, either panic (if
pcb_onfault is not set) or arrange to restart at the location in
pcb_onfault.

This ought to help the stability of a system under moderate load. It
certainly stops DDB from hanging the kernel when it tries to access a
non-present page.
2001-10-24 21:20:50 +00:00
marcel
c65eec68e0 Remove call to cninit_finish. This is part of the multiple
low-level console support.
2001-10-24 08:06:55 +00:00
marcel
ce33a29709 Add parse functions for local APIC and I/O APIC entries.
Also, show when a local APIC or SAPIC is disabled.
2001-10-24 04:48:05 +00:00
peter
e0641b4c8a Fix RAW dependency violation when compiled with gcc-3
Warning: Use of 'br.ret.sptk.many' violates RAW dependency 'PSR.tb' (data)
2001-10-23 22:23:22 +00:00
peter
991f9ba4be Turn off the single-user override. We've been running multi-user
for some time.  Having a machine boot unattended is useful. :-)
2001-10-23 11:04:43 +00:00
dfr
5f34b1282c Add data serialisations after ptc and mov to rr[] instructions. 2001-10-23 10:20:04 +00:00
mike
47a3c1f5da Remove funky right justification.
Pointed out by:	bde
2001-10-23 00:42:15 +00:00
dfr
9ecacc3d02 In the signal trampoline, flush the register stack before calling
sigreturn. This appears to fix the last set of problems with csh.
2001-10-22 19:43:05 +00:00
obrien
b9c90ee7fc Setup for a 200MB FS -- 209715200/512= 409600 sectors.
(DFR's latest ia64-root-*.tar.gz leaves only 7.7M avail when created by
dd if=/dev/zero of=ia64-root.fs bs=1024k count=200)
2001-10-22 07:33:38 +00:00
des
f4cecd8fd8 Move procfs_* from procfs_machdep.c into sys_process.c, and rename them to
proc_* in the process; procfs_machdep.c is no longer needed.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 23:57:24 +00:00
des
68ea04e864 [partially forced commit due to pilot error in earlier commit attempt]
{set,fill}_{,fp,db}regs() fixup:

 - Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:16:48 +00:00
des
8cf224f4f0 {set,fill}_{,fp,db}regs() fixup:
- Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
{set,fill}_{,fp,db}regs() fixup:

 - Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:14:00 +00:00
dfr
c675cb3a12 Add some more names for bits of trapframe. 2001-10-21 14:03:58 +00:00
dfr
cc544c9517 We need to save a bit more information in the partial syscall trapframe
in case we need to take a signal.
2001-10-21 14:03:25 +00:00
dfr
aa82e31802 Set ar.fpsr to something sane before trying to handle a trap - the user
might have trashed it.
2001-10-21 14:02:27 +00:00
dfr
4c9a6f8d23 Use ia64_set_fpsr() instead of __asm to set ar.fpsr. 2001-10-21 14:01:48 +00:00
dfr
0e3e05fd5d Add ia64_set_fpsr(). 2001-10-21 14:00:59 +00:00
marcel
e7d875c143 Implement the IPI send functions. No mapping between IPI message
Id and interrupt vector has been made yet.
2001-10-21 08:57:02 +00:00
marcel
86656e8047 Add define for the PIB default address and include a reference to
the SDM.
2001-10-21 05:52:54 +00:00
mjacob
bdff8645a6 Remove wx. 2001-10-20 18:50:31 +00:00
dfr
7cb77dfe12 Reserve space for signal state. 2001-10-20 15:19:43 +00:00
marcel
11dcd74077 Save the AP wake-up vector from the SAL descriptor under SMP.
Note that the descriptor is optional. Add a comment to indicate
that we want to register the OS_BOOT_RENDEZ here as well.
2001-10-20 03:39:55 +00:00
marcel
35cc982506 Make this compile under option SMP. 2001-10-20 03:33:07 +00:00
dfr
7ebbe27eff Make a start at an unaligned trap handler. Only integer loads and stores
are handled so far.
2001-10-19 22:23:51 +00:00
dfr
242c14f742 Translate various userland traps into SIGBUS (instead of just panicing). 2001-10-19 20:46:12 +00:00
ru
b514c94182 Try two on the preprocessing logic.
Reviewed by:	obrien
2001-10-19 20:06:23 +00:00
jhb
d0bdf2ae5d Remove unneeded sys/mutex.h includes. 2001-10-19 19:23:32 +00:00
obrien
975b6d2e75 Blah, fix braino where ru had to remind me of proper preprocessor syntax.
Bad fingers, no cookie.
2001-10-19 19:17:11 +00:00
dfr
220747715a Rework pmap so that it separates the PTE structure from the pv_entry
structure. This makes it possible to pre-allocate PTEs for the kernel,
which is necessary for a reliable implementation of pmap_kenter(). This
also avoids wasting space (about 48 bytes per page) for kernel mappings
and user mappings of memory-mapped devices.

This also fixes a bug with the previous version where the implementation
required the pv_entry structure to be physically contiguous but did not
enforce this (the structure size was not a power of two). This meant
that the pv_entry free list was quickly corrupted as soon as the system
was even mildly loaded.
2001-10-19 09:47:02 +00:00
dfr
acb4f4cc33 Shift the code which packs and unpacks instruction bundles out of DDB
since it is useful for various emulations duties (e.g. unaligned trap
handling).
2001-10-18 16:20:04 +00:00
marcel
8542877fb0 Fix typos in previous commit:
o  s/sys_narg/sy_narg/
o  s/SYS_MPSAFE/SYF_MPSAFE/
2001-10-18 05:21:52 +00:00
obrien
1d7ce16d9a Add support for "__gnuc_va_list". Some overly "smart" libraries assume
the existence of the __gnuc_va_list type[*] because our compiler is GCC.

[*] __gnuc_va_list is defined in the GCC ginclude/stdarg.h replacement
headerwhich we don't use.
2001-10-18 00:27:39 +00:00
jhb
d51a15e1db - Small cleanups to the Giant handling in trap().
- Only release Giant in trap() if we locked it, otherwise we could release
  Giant in a kernel trap if we didn't get it for a page fault and the
  previous frame had grabbed the lock.
- Only get Giant for !MP safe syscalls.
2001-10-17 22:04:45 +00:00
mjacob
e666e03e1a Make SCSI changer and SES devices standard in generic kernels.
Reviewed by:	ken@kdm.org
2001-10-16 22:22:58 +00:00
dfr
19a85de402 Size the number of pv_entries we use to bootstrap the pv_entry allocator
based on the size of physical memory. This should eliminate the tweaking
needed for larger memory configurations.
2001-10-16 08:03:16 +00:00
marcel
1dc835d4bd When compiling with SKI support, create the fake memory regions
when either the memory descriptor in the bootinfo is NULL or
the descriptor count is 0.
2001-10-15 07:58:27 +00:00
dfr
ac1e1976ef Only the first eight arguments can possibly be in stacked registers. 2001-10-13 08:06:20 +00:00
dfr
66ae82dae0 Pass the correct trapframe pointer to fork_exit - sp is trapframe-16. 2001-10-12 11:50:09 +00:00
dfr
46f68d627c If the faulting instruction is a cmpxchg, then isr.w and isr.r will both
be set. We need to check isr.w before isr.r so that we can correctly
handle a cmpxchg to a copy-on-write page.

This fixes the hang-after-fork problem for dynamically linked programs.
2001-10-12 11:49:11 +00:00
dfr
e18643f7d6 Implement MCOUNT hook for assembler. Probably doesn't work right. 2001-10-11 13:35:31 +00:00
dfr
0d5aa1a03b Implement mcount trampoline (untested). 2001-10-11 13:31:55 +00:00
dfr
f16813dcd5 * Change the calling convention for execve so that it conforms to normal
C calling conventions. This allows crt1.c to be written nearly without
  any inline assembler.
* Initialise cpu_model[] so that the hw.model sysctl works properly.
2001-10-11 12:31:50 +00:00
ps
db0d5cd641 Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
tunable.

Reviewed by:	peter
MFC after:	2 weeks
2001-10-10 23:06:54 +00:00
dfr
adca9bb8ab Add a definition for the ia64's special PLT_RESERVE entry in the _DYNAMIC
section.
2001-10-10 09:00:27 +00:00
dfr
ffdeb5e0d7 Clarify a comment.
Requested by: jhb
2001-10-09 19:50:29 +00:00
dfr
14cba3ae53 Don't include isavar.h - we don't need it. 2001-10-09 10:24:37 +00:00
dfr
cbcbd1952c Add a minimalist kernel config which can run inside SKI. 2001-10-09 10:14:06 +00:00
dfr
53b8dff6c7 Make printtrap() more informative. 2001-10-08 20:21:04 +00:00
dfr
0dc299a882 Implement inline versions of ntohl etc. 2001-10-07 21:09:35 +00:00
des
29c5c858fc Dissociate ptrace from procfs.
Until now, the ptrace syscall was implemented as a wrapper that called
various functions in procfs depending on which ptrace operation was
requested.  Most of these functions were themselves wrappers around
procfs_{read,write}_{,db,fp}regs(), with only some extra error checks,
which weren't necessary in the ptrace case anyway.

This commit moves procfs_rwmem() from procfs_mem.c into sys_process.c
(renaming it to proc_rwmem() in the process), and implements ptrace()
directly in terms of procfs_{read,write}_{,db,fp}regs() instead of
having it fake up a struct uio and then call procfs_do{,db,fp}regs().

It also moves the prototypes for procfs_{read,write}_{,db,fp}regs()
and proc_rwmem() from proc.h to ptrace.h, and marks all procfs files
except procfs_machdep.c as "optional procfs" instead of "standard".
2001-10-07 20:08:42 +00:00
dfr
aadf7f2191 * Use srlz.i to serialise changes to psr.ic
* Don't enable psr.i at the same time as psr.dt and psr.ic

These changes improve stability considerably.
2001-10-07 18:40:01 +00:00
dfr
006ac09328 Remove bogus include. 2001-10-07 14:20:01 +00:00
dfr
9c40c48b35 Move console probes until after we set boothowto so that 'boot -h' works. 2001-10-06 16:06:48 +00:00
dfr
9aa18339c5 Assume round-to-nearest mode for floating point. 2001-10-06 15:57:22 +00:00
dfr
db02c4b19d Delete legacy pcib code - we can't possibly work without acpi on ia64. 2001-10-06 10:09:57 +00:00
marcel
1cf975d017 o Change ia64_memory_address to explicitly take a u_int64_t
o  Add memcpy_fromio, memcpy_io, memcpy_toio, memset_io,
   memsetw and memsetw_io. I'm not sure this is the right
   place for it, though.
2001-10-06 09:31:43 +00:00
dfr
3908c08eda Add BOOTP support. 2001-10-05 19:03:01 +00:00
dfr
1b40dafbcc Fix some dependency violations (don't know why gas didn't catch this). 2001-10-05 19:02:21 +00:00
dfr
628e798360 Use physical addresses, not virtual addresses when calling PHYS_TO_VM_PAGE. 2001-10-05 19:00:03 +00:00
dfr
9e6ea50a9e Eliminate some alpha craziness. 2001-10-05 18:59:02 +00:00
dfr
603bf5b632 In in_cksumdata, len must be a signed type. 2001-10-05 18:58:22 +00:00
dfr
c307754b5d Low-level code for programming the I/O SAPIC. 2001-10-05 10:35:42 +00:00
dfr
8d0fc6ad69 Wire up most of the interrupt handling infrastructure. Not sure it works
right yet but its enough for the ATA probe to work. The SCSI probes which
follow are broken though.
2001-10-05 10:30:09 +00:00
dfr
9a18cc66ce Fix typo which meant that we never actually found the ACPI 2.0 table. 2001-10-05 10:29:03 +00:00
dfr
ef3435232b Disable interrupts when we are in DDB. 2001-10-05 08:23:08 +00:00
dfr
17d5b062c9 Add ia64_get_lid(). 2001-10-05 08:20:41 +00:00
dfr
618109d59e Don't pretend the argument to clockattach is a device - it isn't. 2001-10-04 15:28:27 +00:00
dfr
874825c3ca * Don't pretend the object passed to clockattach is a device - it isn't.
* Declare itc_frequency properly.
2001-10-04 15:27:35 +00:00
dfr
62360262bb Use EFI (or some reasonable simulation) to read the RTC. 2001-10-04 15:26:05 +00:00
dfr
7ed4fe7528 Fake the EFI runtime call GetTime. 2001-10-04 15:24:52 +00:00
dfr
b5a44e4761 Add low-level ACPI support code and make a start on parsing the ACPI
interrupt information.
2001-10-04 08:45:19 +00:00
dfr
17f2c62587 The encoding for the bus being passed to SAL was completely wrong. 2001-10-03 08:25:58 +00:00