Commit Graph

130 Commits

Author SHA1 Message Date
Doug Rabson
5577bd2bca 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
Doug Rabson
ef826b3ca8 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
David E. O'Brien
4a3391b5a1 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
Doug Rabson
47806f084a Implement MCOUNT hook for assembler. Probably doesn't work right. 2001-10-11 13:35:31 +00:00
Doug Rabson
b4cc6db2df Implement mcount trampoline (untested). 2001-10-11 13:31:55 +00:00
Paul Saab
cbc89bfbfe Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
tunable.

Reviewed by:	peter
MFC after:	2 weeks
2001-10-10 23:06:54 +00:00
Doug Rabson
d91b6696b7 Add a definition for the ia64's special PLT_RESERVE entry in the _DYNAMIC
section.
2001-10-10 09:00:27 +00:00
Doug Rabson
e4ef1eb797 Implement inline versions of ntohl etc. 2001-10-07 21:09:35 +00:00
Doug Rabson
d0ad824d68 Assume round-to-nearest mode for floating point. 2001-10-06 15:57:22 +00:00
Marcel Moolenaar
18819cbb5c 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
Doug Rabson
7a7029581c 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
Doug Rabson
c7521efc59 Add ia64_get_lid(). 2001-10-05 08:20:41 +00:00
Doug Rabson
02c76ceb97 Don't pretend the argument to clockattach is a device - it isn't. 2001-10-04 15:28:27 +00:00
Doug Rabson
f17bd83f5f Add a couple of arguments to ia64_init. I'll use them later to improve
the method of passing bootinfo from the loader.
2001-09-29 11:44:35 +00:00
Doug Rabson
625768e4a0 Start hooking up devices. 2001-09-29 11:11:18 +00:00
Doug Rabson
9a6f25fd59 Add pmap_unmapdev(). 2001-09-29 11:02:06 +00:00
Doug Rabson
ddead4655a Fill out the firmware interfaces somewhat. 2001-09-29 11:01:24 +00:00
Doug Rabson
32956c3d49 We need different call stubs for static and stacked calling conventions. 2001-09-24 19:41:16 +00:00
Doug Rabson
378482865e Factor out PTE and related definitions from pmap.h - they are useful in
the loader.
2001-09-24 19:27:38 +00:00
Doug Rabson
3995e0ebca Add definitions of SAL System Table. 2001-09-23 10:26:20 +00:00
Doug Rabson
23a7118905 Add implementations of readx() and writex(). 2001-09-22 19:51:18 +00:00
Doug Rabson
137fd2af89 Add declaration of ia64_running_in_simulator(). 2001-09-22 19:50:54 +00:00
Doug Rabson
85d6f9f7d3 Add ia64_fc(). 2001-09-21 10:09:27 +00:00
John Baldwin
fdca1cb1ef Whitespace fixes. 2001-09-18 21:52:15 +00:00
John Baldwin
fd54558a83 - If we ever do the per-cpu KTR stuff, the index won't be volatile as it
will be private to each CPU.
- Re-style(9) the globaldata structures.  There really needs to be a MI
  struct pcpu that has a MD struct mdpcpu member at some point.
2001-09-18 21:46:26 +00:00
Doug Rabson
a5e2a508c7 Add ia64_get_cpuid(). 2001-09-18 15:21:18 +00:00
Doug Rabson
91a8883e5b Implement inx() and outx() functions for accessing I/O ports. 2001-09-15 12:30:56 +00:00
Doug Rabson
749520911b Add ia64_mf_a() which executes an mf.a instruction. 2001-09-15 12:30:19 +00:00
Doug Rabson
3a0b4f259c Fill out some gaps in ia64 DDB support. This involves generalising DDB's
breakpoint handling slightly to cope with the fact that ia64 instructions
are not located on byte boundaries.
2001-09-15 11:06:07 +00:00
Doug Rabson
0b02d706db * Enable dynamically linked kernel. This involves adding a self-relocator
to locore to process the @fptr relocations in the dynamic executable.
* Don't initialise the timer until *after* we install the timecounter to
  avoid a race between timecounter initialisation and hardclock.
* Tidy up bootinfo somewhat including adding sanity checks for when the
  kernel is loaded without a recognisable bootinfo.
2001-09-13 12:39:15 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Doug Rabson
e763b778c8 * Make a start on a realistic definition for bootinfo.
* Switch to proc0's stack and backing store before calling ia64_init
  so that we don't rely on the loader's stack at all.
* Change kernel entry point name from locorestart to __start.
2001-09-10 13:40:00 +00:00
Doug Rabson
d452f533f7 Add options to select between 4k, 8k and 16k page sizes on ia64. The
default is now 8k.
2001-09-07 11:03:39 +00:00
Doug Rabson
4ce0b9f86d Add struct tags to avoid warnings in kernel code. 2001-09-06 18:11:16 +00:00
David E. O'Brien
1792335469 style(9) the structure definitions. 2001-09-05 01:36:46 +00:00
Doug Rabson
093a61588e Add a working version of setjmp/longjmp.
Obtained from: Intel's EFI toolkit.
2001-09-03 13:54:50 +00:00
Mike Barcroft
03516cfeb0 o Remove some GCCisms in src/powerpc/include/endian.h.
o Unify <machine/endian.h>'s across all architectures.
o Make bswapXX() functions use a different spelling of u_int16_t and
  friends to reduce namespace pollution.  The bswapXX() functions
  don't actually exist, but we'll probably import these at some
  point.  Atleast one driver (if_de) depends on bswapXX() for big
  endian cases.
o Deprecate byteorder(3) prototypes from <sys/types.h>, these are
  now prototyped indirectly in <arpa/inet.h>.
o Deprecate in_addr_t and in_port_t typedefs in <sys/types.h>, these
  are now typedef'd in <arpa/inet.h>.
o Change byteorder(3) prototypes to use standards compliant uint32_t
  (spelled __uint32_t to reduce namespace pollution).
o Document new preferred headers and standards compliance.

Discussed with:	bde
PR:		29946
Reviewed by:	bmilekic
2001-08-30 00:04:19 +00:00
Peter Wemm
547a9e66fd vm_page_zero_idle() is no longer MD. 2001-08-25 04:54:25 +00:00
Peter Wemm
95a6562598 Strip out some #if's for old implementations of global data pointers. 2001-08-21 22:14:13 +00:00
David E. O'Brien
589278dbae style(9) and make consistent across platforms 2001-08-16 09:29:35 +00:00
Andrey A. Chernov
2a54e09dff OFF_T -> OFF (more standard style) 2001-08-15 19:50:59 +00:00
Andrey A. Chernov
a6314641a4 Add OFF_T_MAX/OFF_T_MIN 2001-08-15 19:25:08 +00:00
David E. O'Brien
059d1e91d8 Style changes to commonize the various platforms. 2001-08-15 04:02:41 +00:00
John Baldwin
688ebe120c - Close races with signals and other AST's being triggered while we are in
the process of exiting the kernel.  The ast() function now loops as long
  as the PS_ASTPENDING or PS_NEEDRESCHED flags are set.  It returns with
  preemption disabled so that any further AST's that arrive via an
  interrupt will be delayed until the low-level MD code returns to user
  mode.
- Use u_int's to store the tick counts for profiling purposes so that we
  do not need sched_lock just to read p_sticks.  This also closes a
  problem where the call to addupc_task() could screw up the arithmetic
  due to non-atomic reads of p_sticks.
- Axe need_proftick(), aston(), astoff(), astpending(), need_resched(),
  clear_resched(), and resched_wanted() in favor of direct bit operations
  on p_sflag.
- Fix up locking with sched_lock some.  In addupc_intr(), use sched_lock
  to ensure pr_addr and pr_ticks are updated atomically with setting
  PS_OWEUPC.  In ast() we clear pr_ticks atomically with clearing
  PS_OWEUPC.  We also do not grab the lock just to test a flag.
- Simplify the handling of Giant in ast() slightly.

Reviewed by:	bde (mostly)
2001-08-10 22:53:32 +00:00
Peter Wemm
2aca0c28d3 Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
are a really nasty interface that should have been killed long ago
when 'ptrace(PT_[SG]ETREGS' etc came along.  The entity that they
operate on (struct user) will not be around much longer since it
is part-per-process and part-per-thread in a post-KSE world.

gdb does not actually use this except for the obscure 'info udot'
command which does a hexdump of as much of the child's 'struct user'
as it can get.  It carries its own #defines so it doesn't break
compiles.
2001-08-08 05:25:15 +00:00
Jake Burkholder
7e5102989e Use a machine dependent type, Elf_Hashelt, for the elements of the elf
dynamic symbol table buckets and chains.  The sparc64 toolchain uses 32
bit .hash entries, unlike other 64 bits architectures (alpha), which use
64 bit entries.

Discussed with: dfr, jdp
2001-07-31 03:46:39 +00:00
John Baldwin
7aa7260e4a Move ast() and userret() to sys/kern/subr_trap.c now that they are MI. 2001-06-29 19:51:37 +00:00
John Baldwin
6be523bca7 Add a new MI pointer to the process' trapframe p_frame instead of using
various differently named pointers buried under p_md.

Reviewed by:	jake (in principle)
2001-06-29 11:10:41 +00:00
David E. O'Brien
f9b58b41a3 Fix style of defines. 2001-06-09 05:21:17 +00:00
Joerg Wunsch
e774b25111 Nuke the various poorly maintained copies of ioctl_fd.h. The file is
not machine-dependant, thus it has been moved out (repo-copied) into
<sys/fdcio.h>.
2001-06-06 06:15:03 +00:00