summaryrefslogtreecommitdiffstats
path: root/sys/ia64
Commit message (Collapse)AuthorAgeFilesLines
* Convert the atomic_ptr() operations over to operating on uintptr_tjhb2005-07-151-58/+19
| | | | | | | | | | variables rather than void * variables. This makes it easier and simpler to get asm constraints and volatile keywords correct. MFC after: 3 days Tested on: i386, alpha, sparc64 Compiled on: ia64, powerpc, amd64 Kernel toolchain busted on: arm
* Add recently invented COMPAT_FREEBSD5 option.kensmith2005-07-141-0/+1
| | | | MFC after: 3 days
* Validate if the value written into {FS,GS}.base is a canonicaldavidxu2005-07-101-1/+2
| | | | | | | | | address, writting non-canonical address can cause kernel a panic, by restricting base values to 0..VM_MAXUSER_ADDRESS, ensuring only canonical values get written to the registers. Reviewed by: peter, Josepha Koshy < joseph.koshy at gmail dot com > Approved by: re (scottl)
* Enhance ia64_flush_dirty() to handle the case in which td != curthread.marcel2005-07-052-23/+52
| | | | | | | | This case is triggered with ptrace(2) and the PT_SETREGS function. Change the return type of the function to int so that errors can be passed on to the caller. Approved by: re (scottl)
* Implement functions calls from within DDB on ia64. On ia64 a functionmarcel2005-07-022-0/+24
| | | | | | | | | | | | | | | | | | | | | | | pointer doesn't point to the first instruction of that function, but rather to a descriptor. The descriptor has the address of the first instruction, as well as the value of the global pointer. The symbol table doesn't know anything about descriptors, so if you lookup the name of a function you get the address of the first instruction. The cast from the address, which is the result of the symbol lookup, to a function pointer as is done in db_fncall is therefore invalid. Abstract this detail behind the DB_CALL macro. By default DB_CALL is defined as db_fncall_generic, which yields the old behaviour. On ia64 the macro is defined as db_fncall_ia64, in which a descriptor is constructed to yield a valid function pointer. While here, introduce DB_MAXARGS. DB_MAXARGS replaces the existing (local) MAXARGS. The DB_MAXARGS macro can be defined by platforms to create a convenient maximum. By default this will be the legacy 10. On ia64 we define this macro to be 8, for 8 is the maximum number of arguments that can be passed in registers. This avoids having to implement spilling of arguments on the memory stack. Approved by: re (dwhite)
* Fix a buglet that was present in the ia64 code and that got inheritedmarcel2005-07-021-0/+1
| | | | | | | | | | | | | | | | | | by amd64 and i386: For buffered writes we collect data and write it out a ${DEV_BSIZE}-sized block at a time. The fragsz variable is used to keep track of how much data we have collected in the buffer so far and it's reset to zero immediately after writing a block to the dump device. When the last, possibly partially filled buffer is flushed, we didn't reset fragsz to 0 and as such would stop reflecting reality. Since we currently only need to do buffered writes once, this isn't a problem. However, when kernel dumps are made by hand (say by callling doadump from within DDB), the improperly cleared state from the first call to dumpsys causes the next call to dumpsys to create an invalid code file. This change resets fragsz after flushing the partially filled buffer so that it fixes the two problems at once. Approved by: re (scottl)
* Jumbo-commit to enhance 32 bit application support on 64 bit kernels.peter2005-06-301-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | This is good enough to be able to run a RELENG_4 gdb binary against a RELENG_4 application, along with various other tools (eg: 4.x gcore). We use this at work. ia32_reg.[ch]: handle the 32 bit register file format, used by ptrace, procfs and core dumps. procfs_*regs.c: vary the format of proc/XXX/*regs depending on the client and target application. procfs_map.c: Don't print a 64 bit value to 32 bit consumers, or their sscanf fails. They expect an unsigned long. imgact_elf.c: produce a valid 32 bit coredump for 32 bit apps. sys_process.c: handle 32 bit consumers debugging 32 bit targets. Note that 64 bit consumers can still debug 32 bit targets. IA64 has got stubs for ia32_reg.c. Known limitations: a 5.x/6.x gdb uses get/setcontext(), which isn't implemented in the 32/64 wrapper yet. We also make a tiny patch to gdb pacify it over conflicting formats of ld-elf.so.1. Approved by: re
* Handle B-unit break instructions. The break.b is unique in that themarcel2005-06-271-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | immediate is not saved by the architecture. Any of the break.{mifx} instructions have their immediate saved in cr.iim on interruption. Consequently, when we handle the break interrupt, we end up with a break value of 0 when it was a break.b. The immediate is important because it distinguishes between different uses of the break and which are defined by the runtime specification. The bottomline is that when the GNU debugger replaces a B-unit instruction with a break instruction in the inferior, we would not send the process a SIGTRAP when we encounter it, because the value is not one we recognize as a debugger breakpoint. This change adds logic to decode the bundle in which the break instruction lives whenever the break value is 0. The assumption being that it's a break.b and we fetch the immediate directly out of the instruction. If the break instruction was not a break.b, but any of break.{mifx} with an immediate of 0, we would be doing unnecessary work. But since a break 0 is invalid, this is not a problem and it will still result in a SIGILL being sent to the process. Approved by: re (scottl)
* Replace the existing copyright notice with my own. Over the years I'vemarcel2005-06-271-23/+19
| | | | | | | changed this file so much that it's equivalent to a rewrite, and I'm not talking about any of the cosmetic changes of course. Approved by: re (scottl)
* Cosmetic: s/u_int64_t/uint64_t/gmarcel2005-06-271-7/+7
| | | | Approved by: re (scottl)
* Add .cvsignore files just like in sys/<arch>/compiled, this keeps CVS fromobrien2005-06-201-0/+1
| | | | | | questing kernel config files not in CVS. Approved by: re(kensmith)
* Define IPI_PREEMPT. Update a nearby comment while I'm here.marcel2005-06-121-2/+3
|
* Introduce a procedure, pmap_page_init(), that initializes thealc2005-06-101-33/+20
| | | | | | | | | | | | | | | | | | | 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
* MFP4:jkoshy2005-06-091-0/+14
| | | | | | | | | | | | | | | | - 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.
* Create nexus in configure_first() instead of in configure(). Thismarcel2005-05-291-2/+2
| | | | | makes sure that sysinit tasks that run after configure_first(), but before configure() have a nexus to hang devices off.
* Call cninit_finish() in configure_final().marcel2005-05-291-0/+2
|
* 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)
* - Move bus dependent defines to {isa,cbus}_dmareg.h.nyan2005-05-141-1/+1
| | | | | | - Use isa/isareg.h rather than <arch>/isa/isa.h. Tested on: i386, pc98
* Don't define _MACHINE_BUS_MEMIO_H_ nor _MACHINE_BUS_PIO_H_.marcel2005-05-101-3/+0
|
* Change cpu_set_kse_upcall to more generic style, so we can reuse itdavidxu2005-04-231-13/+20
| | | | | | | 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.
* Sanity the RTC code:marcel2005-04-224-398/+130
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a kpte command to DDB. It dumps the PTE of a KVA. This helpsmarcel2005-04-161-0/+20
| | | | to analyze faults and TLB/VHPT inconsistencies.
* Return better "error" values for UWX_BOTTOM and UWX_ABI_FRAME inmarcel2005-04-162-6/+21
| | | | | | | | | | | | unw_step(). Both errors denote the end of a stack trace (i.e. no prior frame), but are otherwise not error conditions. Have db_trace() return 0 when the trace ends due to one of these return codes as they are really normal termination conditions. This change especially improves the output of the "show thread" command in DDB when there are threads in fork_trampoline() and previously db_trace() would return an error, causing the show command to emit '***'.
* Initialize curthread before we save the APs MCA state. Saving themarcel2005-04-151-6/+8
| | | | | | | | MCA state requires a spin lock, which requires a valid curthread. This change allows SMP kernels to boot into multi-user again. While here, update the copyright notice and use __FBSDID for the revision string.
* Use PCPU_LAZY_INC() for cnt.v_{intr,trap,syscalls} rather than atomicjhb2005-04-123-5/+5
| | | | operations in some places and simple non-per CPU math in others.
* Dot the i's:marcel2005-04-121-5/+7
| | | | | | | | | | | | | | | | | 1 Move the debug.clock_adjust_* sysctls to debug.clock.adjust_* to make it easier to get only the clock statistics. 2 Make the sysctls read-only [suggested by Marius]. 3 When determining the new clock adjustment, we checked for an error either larger than 12.5% or smaller than 12.5%. We left out an error of exactly 12.5%. For errors larger than 12.5% we adjust the clock reload value in such a way that the next clock interrupt would be early (as in premature). For errors less than 12.5% we stopped the adjustment. The current algorithm doesn't benefit from excluding an error of exactly 12.5%. Change the code to stop adjusting the clock if the error is *not* larger than 12.5% [suggested by Marius]. Discussed with: marius@
* Divorce critical sections from spinlocks. Critical sections as denoted byjhb2005-04-046-147/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add USB Communication Device Class Ethernet driver. Originally written forsobomax2005-03-221-0/+1
| | | | | | | | | | FreeBSD based on aue(4) it was picked by OpenBSD, then from OpenBSD ported to NetBSD and finally NetBSD version merged with original one goes into FreeBSD. Obtained from: http://www.gank.org/freebsd/cdce/ NetBSD OpenBSD
* s/SLIST/STAILQ to catch up with changes to resource lists.njl2005-03-201-2/+2
| | | | Missed by: imp
* Add a comment to note that pseudo-device bpf is required for DHCP.murray2005-03-181-0/+1
| | | | | | | | | This is mentioned in the Handbook but it is not as obvious to new users why bpf is needed compared to the other largely self-explanatory items in GENERIC. PR: conf/40855 MFC after: 1 week
* Split configure() into 3 separate steps like we do on otheriedowse2005-03-181-1/+18
| | | | | | | architectures. This makes it possible to insert hooks before and after the device attachment step. Tested thanks to: marcel
* 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.
* Remove dead code.scottl2005-03-071-17/+0
|
* 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
* Make sure fpswa_iface equals NULL when bootinfo.bi_fpswa equals 0.marcel2005-03-021-1/+2
| | | | | | | | | We need to be able to test for the (possible) non-existence of the FPSWA code. PR: ia64/77591 Submitted by: Christian Kandeler (christian dot kandeler at hob dot de) MFC after: 1 day
* Attempt to doff the pointy hat: implement 'hw.realmem' on remainingwes2005-03-011-0/+2
| | | | | | architectures. Pointed out by O'Brien, ScottL via email. Reviewed by: obrien (various)
* Remove acpi_perf from {ARCH}/conf/NOTES, to make tinderbox happy.delphij2005-02-251-3/+0
| | | | | Reported by: tinderbox Inspired by: acpi_perf build structure removal commit
* Use a common multi-inclusion protection, and add such aru2005-02-191-1/+6
| | | | protection to alpha/include/exec.h.
* s/descr/oid_descr/marcel2005-02-091-1/+1
|
* Since we are quite unlikely to ever face another platform whichphk2005-02-061-18/+13
| | | | | | | | | uses the i8237 without trying to emulate the PC architecture move the register definitions for the i8237 chip into the central include file for the chip, except for the PC98 case which is magic. Add new isa_dmatc() function which tells us as cheaply as possible if the terminal count has been reached for a given channel.
* Finish the job of sorting all includes and fix the build by includingnjl2005-02-061-28/+33
| | | | | | malloc.h before proc.h on sparc64. Noticed by das@ Compiled on: alpha, amd64, i386, pc98, sparc64
* Build cpufreq and acpi_perf on platforms that are likely to be able tonjl2005-02-051-0/+4
| | | | use them.
* Include sys/bus.h before sys/cpu.h. The latter needs device_t.marcel2005-02-041-0/+1
|
* Add an implementation of cpu_est_clockrate(9). This function estimates thenjl2005-02-041-0/+12
| | | | current clock frequency for the given CPU id in units of Hz.
* nit in /*-imp2005-01-311-1/+1
|
* Fix handling of post increment: Either the first or second operandmarcel2005-01-271-1/+4
| | | | | | | is the register with the memory address, and it's that register's value we need to increment or decrement. MFC after: 3 days
* Fix compile errors. Bah.scottl2005-01-181-2/+2
|
* Fix an assignment that I missed in the last commit.scottl2005-01-151-1/+1
|
OpenPOWER on IntegriCloud