summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include
Commit message (Collapse)AuthorAgeFilesLines
* Do not pre-map the I/O port space. On the Intel Tiger 4 this conflictsmarcel2004-02-221-1/+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@
* 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
* GC the unused <machine/kse.h> file.peter2003-12-241-38/+0
|
* 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.
* 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-071-30/+19
| | | | | | | | | 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.
* Fixed a pedantic syntax error (a stray semicolon at the end ofbde2003-11-171-1/+1
| | | | PCPU_MD_FIELDS).
* - Modify alpha's sf_buf implementation to use the direct virtual-to-alc2003-11-161-0/+57
| | | | | | | | | 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-151-1/+2
| | | | dereference the softc.
* Remove ia64_highfp_load() now that it's unused.marcel2003-11-121-1/+0
|
* Use get_mcontext() to construct the signal context in sendsig() andmarcel2003-11-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Document the lockfunc and lockfuncarg arguments to bus_dma_tag_create() inscottl2003-11-071-0/+4
| | | | the busdma headers.
* Add a bogus definition of __va_list for use by lint. Make it visiblemarcel2003-11-031-1/+5
| | | | only when lint is defined to protect builds with non-GNU compilers.
* Remove headers copied from i386 and either useless or wrong on ia64.marcel2003-11-023-311/+0
| | | | | | | | | | | | | An example of useless is bios.h. An example of wrong is msdos.h (due to the use of long for 32-bit fields). display.h cannot be removed because it's used by syscons. That header however has no platform dependency and shouldn't really be here. Removal if these headers may cause build failures in the ports tree. It's the ports that need fixing in that case. Tested with: buildworld, LINT
* The previous commit removed both clause 3 and clause 4 from the UCBmarcel2003-10-271-3/+4
| | | | | | | | | | | | | | | license. Only clause 3 has been revoked. Restore the fourth clause as clause 3. Pointed out by: das@ Remove my name as a copyright holder since I don't use a BSD license compatible or comparable to the UCB license. I choose not to add a complete second license for my work for aesthetic reasons, nor to replace the UCB license on grounds of rewriting more than 90% of the source files. The rewrite can also be seen as an enhancement and since the files were practically empty, it's rather trivial to have changed 90% of the files.
* Add support for userland to access I/O port space. This is primarilymarcel2003-10-271-12/+13
| | | | | | | | | | | | | | | added for XFree86. There are 2 reasons for doing this with sysarch(): 1. The memory mapped I/O space is not at a fixed physical address. An application has to use some interface to get the base address. It gets worse if the machine has multiple memory mapped I/O spaces. 2. Access to the memory mapped I/O space needs to happen through a translation that is flagged as uncachable. There's no interface that allows a process to do uncached memory I/O, other than though /dev/mem (possibly). So, until we either disallow direct access to I/O or bus space from userland or have a better way of doing this, sysarch() has the least negative impact on existing interfaces.
* Remove unused header. See also ia64/disasm/disasm.h.marcel2003-10-241-1178/+0
|
* Cleanup. Remove the md_flags for threads. It's not used. The flagsmarcel2003-10-231-35/+21
| | | | | | | | we had were bogus. While here, reassign the copyright to the Project. There's nothing in this files that originates from NetBSD, especially now that the FreeBSD/alpha bits have been removed, but even then the amount of inherited code that we actually used was nil.
* Add prototypes for spillfd() and unaligned_fixup().marcel2003-10-231-0/+2
|
* Remove md_bspstore from the MD fields of struct thread. Now thatmarcel2003-10-211-1/+0
| | | | | the backing store is at a fixed address, there's no need for a per-thread variable.
* Put the RSE backing store at a fixed address. This change is triggeredmarcel2003-10-201-0/+2
| | | | | | | | | | | | | by libguile that needs to know the base of the RSE backing store. We currently do not export the fixed address to userland by means of a sysctl so user code needs to hardcode it for now. This will be revisited later. The RSE backing store is now at the bottom of region 4. The memory stack is at the top of region 4. This means that the whole region is usable for the stacks, giving a 61-bit stack space. Port: lang/guile (depended of x11/gnome2)
* Move pmap_resident_count() from the MD pmap.h to the MI pmap.h.bms2003-10-061-1/+0
| | | | | | | | Add a definition of pmap_wired_count(). Add a definition of vmspace_wired_count(). Reviewed by: truckman Discussed with: peter
* Drop any and all support for varargs. There's no history to worrymarcel2003-09-281-14/+1
| | | | | | | about because we're still tier 2 and our current compiler, as well as future compilers will not support varargs. This is mostly a no-op in practice, because <sys/varargs.h> should already cause compile failures.
* Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bitpeter2003-09-251-12/+0
| | | | | | | | | | | | | | | | | | | | | systems where the data/stack/etc limits are too big for a 32 bit process. Move the 5 or so identical instances of ELF_RTLD_ADDR() into imgact_elf.c. Supply an ia32_fixlimits function. Export the clip/default values to sysctl under the compat.ia32 heirarchy. Have mmap(0, ...) respect the current p->p_limits[RLIMIT_DATA].rlim_max value rather than the sysctl tweakable variable. This allows mmap to place mappings at sensible locations when limits have been reduced. Have the imgact_elf.c ld-elf.so.1 placement algorithm use the same method as mmap(0, ...) now does. Note that we cannot remove all references to the sysctl tweakable maxdsiz etc variables because /etc/login.conf specifies a datasize of 'unlimited'. And that causes exec etc to fail since it can no longer find space to mmap things.
* Implement the bus_space_map() function to allocate resources and initializenyan2003-09-231-5/+12
| | | | a bus_handle, but currently it does only initializing a bus_handle.
* Change TRAPF_USERMODE and CLOCKF_USERMODE to not test for CPL == 3,marcel2003-09-191-2/+2
| | | | | | | | | | but for CPL != 0. For some reason yet unknown it is possible for the CPL to be 2. This would previously be counted as kernel mode, which resulted in nasty panics. By changing the test it is now treated as user mode, which is more correct. We still need to figure out how it is possible that the privilege level can be 2 (or 1 for that matter), because it's not used by us. We only use 3 (user mode) and 0 (kernel mode).
* Rewrite the SAPIC initialization to always program the RTEs with whatmarcel2003-09-101-5/+5
| | | | | | | | we think is the correct trigger mode and polarity. This allows us to implement BUS_CONFIG_INTR() as an update of the RTE in question. Consequently, we can trust the RTE when we enable an interrupt and avoids that we need to know about the trigger mode and polarity at that time.
* Introduce IA64_ID_PAGE_{MASK|SHIFT|SIZE} and LOG2_ID_PAGE_SIZE. Themarcel2003-09-091-0/+11
| | | | | | | | | | latter is a kernel option for IA64_ID_PAGE_SHIFT, which in turn determines IA64_ID_PAGE_MASK and IA64_ID_PAGE_SIZE. The constants are used instead of the literal hardcoding (in its various forms) of the size of the direct mappings created in region 6 and 7. The default and probably only workable size is still 256M, but for kicks we use 128M for LINT.
* Fix a place where I forgot to change the code that checks whethermarcel2003-09-051-1/+1
| | | | | | | | | | | | | | | | | we return to kernel or userland. This triggered a panic in a KSE application when TDF_USTATCLOCK was set in the case userland was interrupted, but we never called ast() on our way out. As such, we called ast() at some other time. Unfortunately, TDF_USTATCLOCK handling assumes running in the interrupt thread. This was not the case anymore. To avoid making the same mistake later, interrupt() now returns to its caller whether we interrupted userland or not. This avoids that we have to duplicate the check in assembly, where it's bound to fall off the scope. Now we simply check the return value and call ast() if appropriate. Run into this: davidxu
* Remove PAGE_SIZE_4K, PAGE_SIZE_8K and PAGE_SIZE_16K and replace themmarcel2003-08-231-16/+4
| | | | | with LOG2_PAGE_SIZE. A single option is better to LINT than multiple mutual exclusive ones.
* Undo the mistake made in revision 1.77 of trap.c and which was themarcel2003-08-201-11/+6
| | | | | | | | | | | | | | | | | | ultimate trigger for the follow-up fixes in revisions 1.78, 1.80, 1.81 and 1.82 of trap.c. I was simply too pre-occupied with the gateway page and how it blurs kernel space with user space and vice versa that I couldn't see that it was all a load of bollocks. It's not the IP address that matters, it's the privilege level that counts. We never run in user space with lifted permissions and we sure can not run in kernel space without it. Sure, the gateway page is the exception, but not if you look at the privilege level. It's user space if you run with user permissions and kernel space otherwise. So, we're back to looking at the privilege level like it should be. There's no other way. Pointy hat: marcel
* Further cleanup <machine/cpu.h> and <machine/md_var.h>: move the MImarcel2003-08-162-29/+23
| | | | | | | | | | | | | | | | | | | prototypes of cpu_halt(), cpu_reset() and swi_vm() from md_var.h to cpu.h. This affects db_command.c and kern_shutdown.c. ia64: move all MD prototypes from cpu.h to md_var.h. This affects madt.c, interrupt.c and mp_machdep.c. Remove is_physical_memory(). It's not used (vm_machdep.c). alpha: the MD prototypes have been left in cpu.h with a comment that they should be there. Moving them is left for later. It was expected that the impact would be significant enough to be done in a seperate commit. powerpc: MD prototypes left in cpu.h. Comment added. Suggested by: bde Tested with: make universe (pc98 incomplete)
* Add an instruction group break after the move to application registermarcel2003-08-151-2/+2
| | | | | | | and the move to control register to avoid dependency violations when these functions are used. Note that explicit data and instruction serialization also need to be in a subsequent instruction group. This too requires that we have an igrp break here.
* Introduce two machine specific ptrace(2) requests: PT_GETKSTACK andmarcel2003-08-151-2/+8
| | | | | | | | | | | | | | | | | | PT_SETKSTACK. These requests allow the tracing process to access the dirty registers of the traced process that are on the kernel stack. Note that there's currently no way to access the rnat register for those dirty registers that are not (yet) covered by a nat collection point. The interface for this is still being slept on. Also note that implied by these requests is the division of work: The tracing process has to keep track of where registers are spilled and is responsible to figure out where the NaT bit of the stacked registers are at any time during the execution of the traced process. The kernel provides the interfaces but will not abstract the fact that the register stack can be split. This model does not follow the approach taken in Linux where PT_PEEK and PT_POKE deals with this automagically.
* Expand inline the relevant parts of src/COPYRIGHT for Matt Dillon'simp2003-08-121-2/+24
| | | | | | copyrighted files. Approved by: Matt Dillon
* Cleanup prototypes in cpu.h, including fswintrberr and any referencesmarcel2003-08-122-20/+6
| | | | | | to it. Sort the remaining prototypes in cpu.h. No functional change.
* Cleanup and style(9) fixes. No functional change.marcel2003-08-111-7/+4
|
* Consistently use the BSD u_int and u_short instead of the SYSV uint andjhb2003-08-071-1/+1
| | | | | | | ushort. In most of these files, there was a mixture of both styles and this change just makes them self-consistent. Requested by: bde (kern_ktrace.c)
* Better define the flags in the mcontext_t and properly set the flagsmarcel2003-08-071-2/+52
| | | | | | | | | | | | | when we create contexts. The meaning of the flags are documented in <machine/ucontext.h>. I only list them here to help browsing the commit logs: _MC_FLAGS_ASYNC_CONTEXT _MC_FLAGS_HIGHFP_VALID _MC_FLAGS_KSE_SET_MBOX _MC_FLAGS_RETURN_VALID _MC_FLAGS_SCRATCH_VALID Yes, _MC_FLAGS_KSE_SET_MBOX is a hack and I'm proud of it :-)
* - Since td_critnest is now initialized in MI code, it doesn't have to bejhb2003-08-041-2/+0
| | | | | | set in cpu_critical_fork_exit() anymore. - As far as I can tell, cpu_thread_link() has never been used, not even when it was originally added, so remove it.
* Cleanup the clock code. This includes:marcel2003-08-043-25/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Remove alpha specific timer code (mc146818A) and compiled-out calibration of said timer. o Remove i386 inherited timer code (i8253) and related acquire and release functions. o Move sysbeep() from clock.c to machdep.c and have it return ENODEV. Console beeps should be implemented using ACPI or if no such device is described, using the sound driver. o Move the sysctls related to adjkerntz, disable_rtc_set and wall_cmos_clock from machdep.c to clock.c, where the variables are. o Don't hardcode a hz value of 1024 in cpu_initclocks() and don't bother faking a stathz that's 1/8 of that. Keep it simple: hz defaults to HZ and stathz equals hz. This is also how it's done for sparc64. o Keep a per-CPU ITC counter (pc_clock) and adjustment (pc_clockadj) to calculate ITC skew and corrections. On average, we adjust the ITC match register once every ~1500 interrupts for a duration of 2 consequtive interruprs. This is to correct the non-deterministic behaviour of the ITC interrupt (there's a delay between the match and the raising of the interrupt). o Add 4 debugging sysctls to monitor clock behaviour. Those are debug.clock_adjust_edges, debug.clock_adjust_excess, debug.clock_adjust_lost and debug.clock_adjust_ticks. The first counts the individual adjustment cycles (when the skew first crosses the threshold), the second counts the number of times the adjustment was excessive (any non-zero value is to be considered a bug), the third counts lost clock interrupts and the last counts the number of interrupts for which we applied an adjustment (debug.clock_adjust_ticks / debug.clock_adjust_edges gives the avarage duration of an individual adjustment -- should be ~2). While here, remove some nearby (trivial) left-overs from alpha and other cleanups.
* Style sync.obrien2003-08-031-8/+9
|
* Don't use uint64_t. Use unsigned long instead. One is supposed to usemarcel2003-08-021-2/+2
| | | | ucontext_t without having to include headers other than <ucontext.h>.
* Deal with 'options KSTACK_PAGES' being a global option.peter2003-07-311-0/+2
|
* - Introduce a new busdma flag BUS_DMA_ZERO to request for zero'edmux2003-07-271-0/+1
| | | | | | | memory in bus_dmamem_alloc(). This is possible now that contigmalloc() supports the M_ZERO flag. - Remove the locking of Giant around calls to contigmalloc() since contigmalloc() now grabs Giant itself.
OpenPOWER on IntegriCloud