summaryrefslogtreecommitdiffstats
path: root/sys/ia64
Commit message (Collapse)AuthorAgeFilesLines
* Do not pre-map the I/O port space. On the Intel Tiger 4 this conflictsmarcel2004-02-223-35/+0
| | | | | | | | | with a memory mapped I/O range that's immediately before it and is not 256MB aligned. As a result, when an address is accessed in the memory mapped range and a direct mapping is added for it, it overlaps with the pre-mapped I/O port space and causes a machine check. Based on a patch from: arun@
* Device megapatch 4/6:phk2004-02-212-2/+4
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 3/6:phk2004-02-211-3/+1
| | | | | | | | | | | | Add missing D_TTY flags to various drivers. Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer. Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures.
* Device megapatch 1/6:phk2004-02-211-2/+0
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* Change the disk(9) API in order to make device removal more robust.phk2004-02-181-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | Previously the "struct disk" were owned by the device driver and this gave us problems when the device disappared and the users of that device were not immediately disappearing. Now the struct disk is allocate with a new call, disk_alloc() and owned by geom_disk and just abandonned by the device driver when disk_create() is called. Unfortunately, this results in a ton of "s/\./->/" changes to device drivers. Since I'm doing the sweep anyway, a couple of other API improvements have been carried out at the same time: The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to DISKFLAG_NEEDSGIANT A version number have been added to disk_create() so that we can detect, report and ignore binary drivers with old ABI in the future. Manual page update to follow shortly.
* Sort PFIL_HOOKS.marcel2004-01-271-1/+1
|
* - Recruit some new ULE users by making it the default scheduler in GENERIC.jeff2004-01-241-1/+1
| | | | | ULE will be in a probationary period to determine whether it will be left as the default in 5.3 which would likely mean the rest of the 5.x series.
* Add PFIL_HOOKS to the GENERIC kernel configuration, primarily sonectar2004-01-241-0/+1
| | | | | | that one can load the IPFilter module (which requires PFIL_HOOKS). Requested by: Many, for over a year
* Fix handling of FP traps:marcel2004-01-201-24/+23
| | | | | | | | | | | | | | | o For traps, the cr.iip register points to the next instruction to execute on interrupt return (modulo slot). Since we need to get the bundle of the instruction that caused the FP fault/trap, make sure we fetch the previous bundle if the next instruction is in fact the first in a bundle. o When we call the FPSWA handler, we need to tell it whether it's a trap or a fault (first argument). This was hardcoded to mean a fault. Also, for FP faults, when a fault is converted to a trap, adjust the cr.iip and cr.ipsr registers to point to the next instruction. This makes sure that the SIGFPE handler gets a consistent state.
* s/framep/tf/g -- this normalizes on the use of tf to point to themarcel2004-01-202-89/+89
| | | | trapframe and improves grep-ability.
* Whitespace nit.des2004-01-131-1/+1
|
* Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'mnectar2004-01-091-0/+1
| | | | | | | | | | at it, use the ANSI C generic pointer type for the second argument, thus matching the documentation. Remove the now extraneous (and now conflicting) function declarations in various libc sources. Remove now unnecessary casts. Reviewed by: bde
* Make sigaltstack as per-threaded, because per-process sigaltstack statedavidxu2004-01-031-8/+8
| | | | | | | | | | | | | is useless for threaded programs, multiple threads can not share same stack. The alternative signal stack is private for thread, no lock is needed, the orignal P_ALTSTACK is now moved into td_pflags and renamed to TDP_ALTSTACK. For single thread or Linux clone() based threaded program, there is no semantic changed, because those programs only have one kernel thread in every process. Reviewed by: deischen, dfr
* Track three new sendfile-related statistics:silby2003-12-281-0/+1
| | | | | | - The number of times sendfile had to do disk I/O - The number of times sfbuf allocation failed - The number of times sfbuf allocation had to wait
* Move the declaration of sfbufspeak and sfbufsused to mbuf.h,silby2003-12-281-2/+1
| | | | | | | and use imax instead of max, as sfbufspeak and sfbufsused are signed. Submitted by: bde
* Track current and peak sfbuf usage, export the values via sysctl.silby2003-12-271-0/+4
|
* Don't use NULL with integral types.marcel2003-12-241-6/+6
|
* Return AE_OK for stub functions returning ACPI_STATUS, not NULLpeter2003-12-241-2/+2
|
* GC the unused <machine/kse.h> file.peter2003-12-241-38/+0
|
* Add an additional field to the elf brandinfo structure to supportpeter2003-12-231-2/+17
| | | | | quicker exec-time replacement of the elf interpreter on an emulation environment where an entire /compat/* tree isn't really warranted.
* Add missing #include "opt_compat.h" so that the compatability functionpeter2003-12-181-0/+2
| | | | | freebsd4_freebsd32_sigreturn() is defined when expected. This should unbreak the tinderbox. Sorry.
* In set_mcontext(), take into account that kse_switchin(2) willmarcel2003-12-141-5/+10
| | | | | | | | | eventually be passed an async. context as well as a syscall context. While here, fix a serious bug in that if the trapframe is a syscall frame, but we're restoring an async context, we need to clear the FRAME_SYSCALL flag so that we leave the kernel via exception_restore.
* Assimilate ia64 back into the fold with the common freebsd32/ia32 code.peter2003-12-1112-3758/+77
| | | | | | | | The split-up code is derived from the ia64 code originally. Note that I have only compile-tested this, not actually run-tested it. The ia64 side of the force is missing some significant chunks of signal delivery code.
* Fix last second typo.peter2003-12-101-1/+1
|
* Use gcc's superior ffs() builtin.peter2003-12-101-0/+9
|
* Use ffs(x) == popcnt(x ^ (x - 1)) to implement 64 bit ffsl(). gcc'speter2003-12-101-8/+15
| | | | ffs() builtin uses this already but truncates the upper 32 bits.
* Don't panic for misalignment traps when the onfault handler is set.marcel2003-12-091-1/+10
| | | | | | | | | | | | | Not all transfers between kernel and user space are byte oriented and thus alignment safe. Especially fuword*() and suword*() are sensitive to alignment but in general more optimal than block copies. By catching the misalignment trap we avoid pessimizing the common case of properly aligned memory accesses which we would do if we were to use byte copies or adding tests for proper alignment. Note that the expectation that the kernel produces aligned pointers is unchanged. This change therefore relates to possible unaligned pointers generated in userland.
* Use the ACPI-CA definitions for the various APIC tables instead of ournjl2003-12-091-45/+41
| | | | own.
* Move the bktr(4) <arch>/include/ioctl_{bt848,meteor}.h files to dev/bktrobrien2003-12-082-475/+0
| | | | | | as these ioctl's aren't MD. This also means they are installed in /usr/include/dev/bktr now. Also provide compatability wrappers for where these headers lived in 4.x.
* Simplify the contexts created by the kernel and remove the relatedmarcel2003-12-072-56/+29
| | | | | | | | | flags. We now create asynchronous contexts or syscall contexts only. Syscall contexts differ from the minimal ABI dictated contexts by having the scratch registers saved and restored because that's where we keep the syscall arguments and syscall return values. Since this change affects KSE, have it use kse_switchin(2) for the "new" syscall context.
* Ooops. These are still used by the bktr driver. David O'Brien hasimp2003-12-071-0/+187
| | | | | | plans for dealing, but I'll let him deal. Pointy hat to: imp@
* Remote meteor driver. It hasn't compiled in over 3 years. If someoneimp2003-12-071-187/+0
| | | | | makes it compile again, and can test it, we can restore the driver to the tree.
* - Split cpu_mp_probe() into two parts. cpu_mp_setmaxid() is still calledjhb2003-11-211-2/+8
| | | | | | | | | | | | | | | | | | | | very early (SI_SUB_TUNABLES - 1) and is responsible for setting mp_maxid. cpu_mp_probe() is now called at SI_SUB_CPU and determines if SMP is actually present and sets mp_ncpus and all_cpus. Splitting these up allows an architecture to probe CPUs later than SI_SUB_TUNABLES by just setting mp_maxid to MAXCPU in cpu_mp_setmaxid(). This could allow the CPU probing code to live in a module, for example, since modules sysinit's in modules cannot be invoked prior to SI_SUB_KLD. This is needed to re-enable the ACPI module on i386. - For the alpha SMP probing code, use LOCATE_PCS() instead of duplicating its contents in a few places. Also, add a smp_cpu_enabled() function to avoid duplicating some code. There is room for further code reduction later since much of this code is also present in cpu_mp_start(). - All archs besides i386 still set mp_maxid to the same values they set it to before this change. i386 now sets mp_maxid to MAXCPU. Tested on: alpha, amd64, i386, ia64, sparc64 Approved by: re (scottl)
* Set the ACPI processor Id in the PCPU structure so that CPU idlingmarcel2003-11-201-1/+1
| | | | | | | | | on SMP systems has a chance of working. This was a loose end of the implementation of the ACPI Cx idle states. Since our logical CPU Id is the ACPI processor Id, we do not need to jump through hoops to obtain it. Approved: re@ (jhb)
* Widen the enable/disable helper function's argument in line with thepeter2003-11-171-1/+1
| | | | ithread_create() changes etc. This should be mostly a NOP.
* Fixed a pedantic syntax error (a stray semicolon at the end ofbde2003-11-171-1/+1
| | | | PCPU_MD_FIELDS).
* - Remove unnecessary synchronization from sf_buf_init(). (There is onlyalc2003-11-161-2/+0
| | | | one active CPU when sf_buf_init() is performed.)
* - Modify alpha's sf_buf implementation to use the direct virtual-to-alc2003-11-162-2/+58
| | | | | | | | | physical mapping. - Move the sf_buf API to its own header file; make struct sf_buf's definition machine dependent. In this commit, we remove an unnecessary field from struct sf_buf on the alpha, amd64, and ia64. Ultimately, we may eliminate struct sf_buf on those architecures except as an opaque pointer that references a vm page.
* Add the pc_acpi_id PCPU member. The new acpi_cpu driver uses this tonjl2003-11-152-1/+3
| | | | dereference the softc.
* Remove ia64_highfp_load() now that it's unused.marcel2003-11-122-15/+0
|
* Further work-out the handling of the high FP registers. The mostmarcel2003-11-123-67/+48
| | | | | | | | | | | | | | | | | | | | | | | | important change is in cpu_switch() where we disable the high FP registers for the thread that we switch-out if the CPU currently has its high FP registers. This avoids that the high FP registers remain enabled for the thread even when the CPU has unloaded them or the thread migrated to another processor. Likewise, when we switch-in a thread of that has its high FP registers on the CPU, we enable them. This avoids an otherwise harmless, but unnecessary trap to have them enabled. The code that handles the disabled high FP trap (in trap()) has been turned into a critical section for the most part to avoid being preempted. If there's a race, we bail out and have the processor trap again if necessary. Avoid using the generic ia64_highfp_save() function when the context is predictable. The function adds unnecessary overhead. Don't use ia64_highfp_load() for the same reason. The function is now unused and can be removed. These changes make the lazy context switching of the high FP registers in an UP kernel functional.
* Save and restore the high FP registers in {g|s}_mcontext(). Notemarcel2003-11-111-2/+9
| | | | | | | | that we currently do not keep track of whether the thread has actually used the high FP registers before. If not, we should not save them in the context which automaticly means that we also would not restore them from the context. For now, do it unconditionally so that we can reach functional completeness.
* Fix a nasty bug that got exposed when the sendsig() and sigreturn()marcel2003-11-112-4/+26
| | | | | | | | | | | | | functions switched to using {g|s}et_mcontext(). The problem is that sigreturn(), being a syscall, can be given an async. context (i.e. one corresponding to an interrupt or trap). When this happens, we try to return to user mode via epc_syscall_return with a trapframe that can only be used to return to user mode via exception_restore. To fix this, we check the frame's flags immediately prior to epc_syscall_return and branch to exception_restore for non-syscall frames. Modify the assertion in set_mcontext() to check that if there's a mismatch, it's because of sigreturn().
* In get_mcontext(), do not update bspstore and ndirty in the trapframe.marcel2003-11-101-5/+9
| | | | | | | | | | | | Only update them in the newly created context to reflect the state after copying the dirty registers onto the user stack. If we were to update the trapframe, we lose the state at entry into the kernel. We may need that after we create the context, such as for KSE upcalls. We have to update the trapframe after writing the dirty registers to the user stack for signal delivery to work. But this is best done in sendsig() itself where it applies, not in get_mcontext() where it's done unconditionally.
* When a thread is being swapped-out, save the high FP registers. Wemarcel2003-11-091-0/+2
| | | | | have a pointer in the PCPU to the PCB of the thread that currently has its high FP registers loaded.
* Use get_mcontext() to construct the signal context in sendsig() andmarcel2003-11-093-109/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use set_mcontext() to restore the context in sigreturn(). Since we put the syscall number and the syscall arguments in the trapframe (we don't save the scratch registers for syscalls, which allows us to reuse the space to our advantage), create a MD specific flag so that we save the scratch registers even for syscalls. We would not be able to restart a syscall otherwise. The signal trampoline does not need to flush the regiters anymore, because get_mcontext() already handles that. In fact, if we set up the context correctly, we do not need to have a trampoline at all. This change however only minimally changes the trampoline code. In follow-up commits this can be further optimized. Note that normally we preserve cfm and iip in the trapframe created by the EPC syscall path when we restore a context in set_mcontext() because those fields are not normally set for a synchronuous context. The kernel puts the return address and frame info of the syscall stub in there. By preserving these fields we hide this detail from userland which allows us to use setcontext(2) for user created contexts. However, sigreturn() is commonly called from the trampoline, which means that if we preserve cfm and iip in all cases, we would return to the trampoline after the sigreturn(), which means we hit the safety net: we call exit(2). So, we do not preserve cfm and iip when we have a synchronous context that also has scratch registers (the uncommon context created by sendsig() only), under the assumption that if such a context is created in userland, something special is going on and the use of cfm and iip is then just another quirk. All this is invisible in the common case.
* Change the clear_ret argument of get_mcontext() to be a flags argument.marcel2003-11-091-2/+2
| | | | | | | | | | Since all callers either passed 0 or 1 for clear_ret, define bit 0 in the flags for use as clear_ret. Reserve bits 1, 2 and 3 for use by MI code for possible (but unlikely) future use. The remaining bits are for use by MD code. This change is triggered by a need on ia64 to have another knob for get_mcontext().
* Remove the atkbd, psm, sc and vga devices. Most ia64 boxes out theremarcel2003-11-082-16/+0
| | | | | | | | | | | | are zx1 based machines and they don't particularly like it when we poke at them with PC legacy code. The atkbd and psm devices were disabled in the hints file so that one could enable them on machines that support legacy devices, but that's not really something you can expect from a first-time installer. This still leaves syscons (sc) and the vga device, which were enabled by default and wrecking havoc anyway. We could disable them by default like the atkbd and psm devices, but there's really no point in pretending we're in a better shape that way.
* Document the lockfunc and lockfuncarg arguments to bus_dma_tag_create() inscottl2003-11-071-0/+4
| | | | the busdma headers.
* Regen.jhb2003-11-073-12/+12
|
OpenPOWER on IntegriCloud