summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include
Commit message (Collapse)AuthorAgeFilesLines
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-293-73/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Don't define _MACHINE_BUS_MEMIO_H_ nor _MACHINE_BUS_PIO_H_.marcel2005-05-101-3/+0
|
* Sanity the RTC code:marcel2005-04-221-53/+0
| | | | | | | | | | | | | | | | | | | | | | | | o Remove the clock interface. Not only does it conflict with the MI version when device genclock is added to the kernel, it was also not possible to have more than 1 clock device. This of course would have been a problem if we actually had more than 1 clock device. In short: we don't need a clock interface and if we do eventually, we should be using the MI one. o Rewrite inittodr() and resettodr() to take into account that: 1) We use the EFI interface directly. 2) time_t is 64-bit and we do need to make sure we can determine leap years from year 2100 and on. Add a nice explanation of where leap years come from and why. 3) This rewrite happened in 2005 so any date prior to 1/1/2005 (either M/D/Y or D/M/Y) is bogus. Reprogram the EFI clock with 1/1/2005 in that case. 4) The EFI clock has a high probability of being correct, so only (further) correct the EFI clock when the file system time is larger. That should never happen in a time-synchronised world. Complain when EFI lost 2 days or more. Replace the copyright notice now that I (pretty much) rewrote all of this file.
* Add empty header (except of the multiple-inclusion protection) tomarcel2005-04-201-0/+10
| | | | get hwpmc(4) to compile on this platform.
* Break out the definition of bus_space_{tag,handle}_t and a few other typesimp2005-04-182-13/+47
| | | | | | | | | | 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
* Divorce critical sections from spinlocks. Critical sections as denoted byjhb2005-04-042-90/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Refactor the bus_dma header files so that the interface is described inscottl2005-03-142-194/+34
| | | | | | | | | | 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.
* netchild's mega-patch to isolate compiler dependencies into a centraljoerg2005-03-027-15/+26
| | | | | | | | | | | | | | | | 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
* Use a common multi-inclusion protection, and add such aru2005-02-191-1/+6
| | | | protection to alpha/include/exec.h.
* nit in /*-imp2005-01-311-1/+1
|
* Add bus_dmamap_load_mbuf_sg() to ia64scottl2005-01-151-0/+2
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-0634-34/+34
|
* Further enhance the handling of misaligned loads and stores:marcel2005-01-021-1/+0
| | | | | | | | | | | | | | | | | | | | o implement double-extended and single precision loads and stores, o implement double precision stores, o replace the machdep.unaligned_print sysctl with debug.unaligned_print and change the default value to 0, o replace the machdep.unaligned_sigbus sysctl with debug.unaligned_test, o Remmove the fillfd() function. The function is trvial enough for inline assembly. The debug.unaligned_test sysctl is used to test the emulation of misaligned loads and stores. When PSR.ac is 0, the CPU will handle misaligned memory accesses itselfi and we don't get an exception for it. When PSR.ac is 1, the process needs to be signalled and we should not emulate. The sysctl takes effect when PSR.ac is 1 and tells us that we should emulate and not send a signal. PR: 72268 MFC after: 1 week
* Use primitive types to avoid creating an artificial header dependency:marcel2004-12-111-11/+11
| | | | | | | | o s/u_long/unsigned long/ o s/uint32_t/unsigned int/g o s/uint64_t/unsigned long/g Trigger case: multimedia/mpeg2codec
* Don't obtain the HCDP address directly from the bootinfo structure.marcel2004-12-081-0/+1
| | | | Use a function to keep the details at arms length from uart(4).
* Change gdb_cpu_setreg() to not take the value to which to set themarcel2004-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | specified register, but a pointer to the in-memory representation of that value. The reason for this is twofold: 1. Not all registers can be represented by a register_t. In particular FP registers fall in that category. Passing the new register value by reference instead of by value makes this point moot. 2. When we receive a G or P packet, both are for writing a register, the packet will have the register value in target-byte order and in the memory representation (modulo the fact that bytes are sent as 2 printable hexadecimal numbers of course). We only need to decode the packet to have a pointer to the register value. This change fixes the bug of extracting the register value of the P packet as a hexadecimal number instead of as a bit array. The quick (and dirty) fix to bswap the register value in gdb_cpu_setreg() as it has been added on i386 and amd64 can therefore be removed and has in fact been that. Tested on: alpha, amd64, i386, ia64, sparc64
* Whitespace fixes:marcel2004-11-281-33/+18
| | | | | | | o Remove a bogus comment that relates to alpha. o s/u_int64_t/uint64_t/g o Add bi_spare2 to make the internal padding explicit. o Move BOOTINFO_MAGIC after the field it applies to.
* Remove struct ia64_itir and use a plain old uint64_t instead.marcel2004-11-211-11/+6
|
* Remove UAREA_PAGES.das2004-11-201-1/+0
| | | | Reviewed by: arch@
* Move the code for halting the CPU (acpi_cpu_c1) into machdep files.njl2004-10-111-0/+2
| | | | | | This removes the last MD portion of acpi_cpu.c. MFC after: 2 weeks
* Move the IA-32 trap handling from trap() to ia32_trap(). Move themarcel2004-09-251-0/+2
| | | | | ia32_syscall() function along with it to ia32_trap.c. When COMPAT_IA32 is not defined, we'll raise SIGEMT instead.
* Redefine a PTE as a 64-bit integral type instead of a struct ofmarcel2004-09-232-91/+56
| | | | | bit-fields. Unify the PTE defines accordingly and update all uses.
* For the atomic_{add|clear|set|subtract} family of inlines, return themarcel2004-09-221-2/+4
| | | | | | old or previous value instead of void. This is not as is documented in atomic(9), but is API (and ABI) compatible and simply makes sense. This feature will primarily be used for atomic PTE updates in PMAP/ng.
* MFp4: various style fixes, includingmarcel2004-09-221-248/+239
| | | | | | | | o s/u_int/uint/g o s/#define<sp>/#define<tab>/g o indent macro definitions o Improve vertical spacing o Globally align line continuation character
* MFp4:marcel2004-09-192-24/+143
| | | | | | Completely remove the remaining EFI includes and add our own (type) definitions instead. While here, abstract more of the internals by providing interface functions.
* Provide our own FPSWA definitions, instead of depending on the Intelmarcel2004-09-172-1/+28
| | | | | | EFI headers and put them all in <machine/fpu.h>. The Intel EFI headers conflict with the Intel ACPI headers (duplicate type definitions), so are being phased out in the kernel.
* Move the kernel-specific logic to adjust frompc from MI to MD. Formarcel2004-08-271-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Get a step closer to profiling the kernel by fixing the definitionsmarcel2004-08-251-5/+5
| | | | | | of the MCOUNT_ENTER, MCOUNT_EXIT and MCOUNT_DECL defines. Also make sure there's a prototype of _MCOUNT_DECL(). This allows us to build a kernel. There are still unresolved symbols, so linking fails.
* Make profiling actually work. The gcc compiler emits a call to themarcel2004-08-253-94/+43
| | | | | | | | | | | | | _mcount() stub when profiling is enabled. Emit this code sequence for assembly routines as welli (MCOUNT definition in <machine/asm.h>. We do not pass the GOT entry however as the 4th argument, because it's not used. The _mcount() stub calls __mcount(), which does the actual work. Define _MCOUNT_DECL to define __mcount. We do not have an implementation of mcount(), so we define MCOUNT as empty, but have a weak alias to _mcount() in _mcount.S. Note that the _mcount() stub in the kernel is slightly different from the stub in userland. This is because we do not have to worry about nested routines in the kernel.
* As I said: the previous commit was untested... Remove an #endif whichmarcel2004-08-161-1/+0
| | | | should have ceased to exist when its corresponding #if was removed.
* Catch up with the drive-by renaming of IA32 to COMPAT_IA32. It mustmarcel2004-08-161-3/+1
| | | | | | | | | | have been rush hour... While here, move COMPAT_IA32 from opt_global.h to opt_compat.h like on amd64. Consequently, it's unsafe to use the option in pcb.h. We now unconditionally have the ia32 specific registers in the PCB. This commit is untested.
* Add __elfN(dump_thread). This function is called from __elfN(coredump)marcel2004-08-111-0/+2
| | | | | | | | | 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
* Better preserve the original protection for the mappings we maintain.marcel2004-08-091-51/+48
| | | | | | | | | | | | | | | | | | | | | | The hardware always gives read access for privilege level 0, which means that we cannot use the hardware access rights and privilege level in the PTE to test whether there's a change in protection. So, we save the original vm_prot_t in the PTE as well. Add pmap_pte_prot() to set the proper access rights and privilege level on the PTE given a pmap and the requested protection. The above allows us to compare the protection in pmap_extract_and_hold() which was missing. While in pmap_extract_and_hold(), add pmap locking. While here, clean up most (i.e. all but one) PTE macros we inherited from alpha. They were either unused, used inconsistently, badly named or simply weren't beneficial. We save the wired and managed state of the PTE in distinct (bit) fields. While in pte.h, s/u_int64_t/uint64_t/g pmap locking obtained from: alc@ feedback & review by: alc@
* De-inline gdb_cpu_signal() because we need to convert the trap vectorsmarcel2004-08-071-7/+1
| | | | | | related to breakpoints and single stepping into SIGTRAP so gdb(1) knows why the remote target has stopped. In particular, gdb(1) needs to know if the reason is something of its own doing.
* Instead of calling ia32_pause() conditionally on __i386__ or __amd64__mux2004-08-031-0/+1
| | | | | | | | | 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
* Remove extraneous ';'.markm2004-08-011-1/+1
|
* Break out the MI part of the /dev/[k]mem and /dev/io drivers intomarkm2004-08-011-0/+38
| | | | | | | | their own directory and module, leaving the MD parts in the MD area (the MD parts _are_ part of the modules). /dev/mem and /dev/io are now loadable modules, thus taking us one step further towards a kernel created entirely out of modules. Of course, there is nothing preventing the kernel from having these statically compiled.
* Fix -O builds with gcc 3.4 by defining ffs as __builtin_ffs instead ofmarcel2004-07-301-6/+1
| | | | creating an inline function that just calls __builtin_ffs.
* Pass a thread argument into cpu_critical_{enter,exit}() rather thanrwatson2004-07-271-8/+4
| | | | | | | | | 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
* Make FLT_ROUNDS correctly reflect the dynamic rounding mode.das2004-07-191-1/+5
|
* Add partial pmap locking.alc2004-07-191-0/+14
| | | | Tested by: marcel@
* Remove unused fields from the pmap.alc2004-07-161-2/+0
|
* Mega update for the KDB framework: turn DDB into a KDB backend.marcel2004-07-101-79/+41
| | | | | | | | | | | | | | | | Most of the changes are a direct result of adding thread awareness. Typically, DDB_REGS is gone. All registers are taken from the trapframe and backtraces use the PCB based contexts. DDB_REGS was defined to be a trapframe on all platforms anyway. Thread awareness introduces the following new commands: thread X switch to thread X (where X is the TID), show threads list all threads. The backtrace code has been made more flexible so that one can create backtraces for any thread by giving the thread ID as an argument to trace. With this change, ia64 has support for breakpoints.
* Update for the KDB framework:marcel2004-07-102-9/+34
| | | | | | | | | | | | | | | | | | | | | o ksym_start and ksym_end changed type to vm_offset_t. o Make debugging support conditional upon KDB instead of DDB. o Call kdb_enter() instead of breakpoint(). o Remove implementation of Debugger(). o Call kdb_trap() according to the new world order. unwinder: o s/db_active/kdb_active/g o Various s/ddb/kdb/g o Add support for unwinding from the PCB as well as the trapframe. Abuse a spare field in the special register set to flag whether the PCB was actually constructed from a trapframe so that we can make the necessary adjustments. md_var.h: o Add RSE convenience macros. o Add ia64_bsp_adjust() to add or subtract from BSP while taking NaT collections into account.
* Implement makectx(). The makectx() function is used by KDB to createmarcel2004-07-101-1/+5
| | | | | | | | | a PCB from a trapframe for purposes of unwinding the stack. The PCB is used as the thread context and all but the thread that entered the debugger has a valid PCB. This function can also be used to create a context for the threads running on the CPUs that have been stopped when the debugger got entered. This however is not done at the time of this commit.
* Introduce the KDB debugger frontend. The frontend provides a frameworkmarcel2004-07-101-0/+58
| | | | | | | | | | | | | | | in which multiple (presumably different) debugger backends can be configured and which provides basic services to those backends. Besides providing services to backends, it also serves as the single point of contact for any and all code that wants to make use of the debugger functions, such as entering the debugger or handling of the alternate break sequence. For this purpose, the frontend has been made non-optional. All debugger requests are forwarded or handed over to the current backend, if applicable. Selection of the current backend is done by the debug.kdb.current sysctl. A list of configured backends can be obtained with the debug.kdb.available sysctl. One can enter the debugger by writing to the debug.kdb.enter sysctl.
* Introduce the GDB debugger backend for the new KDB framework. Themarcel2004-07-101-0/+54
| | | | | | | | | backend improves over the old GDB support in the following ways: o Unified implementation with minimal MD code. o A simple interface for devices to register themselves as debug ports, ala consoles. o Compression by using run-length encoding. o Implements GDB threading support.
* - Remove unused definitions.alc2004-06-231-5/+2
| | | | - Move a definition inside the scope of a #ifdef _KERNEL.
* Backed out previous commit. Blind substitution of dev_t by `struct cdev *'bde2004-06-201-1/+1
| | | | was just wrong here because the dev_t's are user dev_t's.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
OpenPOWER on IntegriCloud