Commit Graph

2075 Commits

Author SHA1 Message Date
Alan Cox
bf5a327d5e Remove avail_end. It is not used. 2004-04-11 05:08:26 +00:00
Alan Cox
b14d6acced - pmap_kenter_temporary() is unused by machine-independent code. Therefore,
move its declaration to the machine-dependent header file on those
   machines that use it.  In principle, only i386 should have it.
   Alpha and AMD64 should use their direct virtual-to-physical mapping.
 - Remove pmap_kenter_temporary() from ia64.  It is unused.  Approved
   by: marcel@
2004-04-10 22:41:46 +00:00
Warner Losh
f36cfd49ad Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson
2004-04-07 20:46:16 +00:00
Warner Losh
3501fd399e Remove the advertsing clause, per the Regent's letter dated July 22, 1999.
Approved by: core
2004-04-05 21:00:51 +00:00
Alan Cox
c8607538c8 Remove avail_start on those platforms that no longer use it. (Only amd64
does anything with it beyond simple initialization.)
2004-04-05 04:08:00 +00:00
Alan Cox
bdb93eb248 Remove unused arguments from pmap_init(). 2004-04-05 00:37:50 +00:00
Alan Cox
9132f23442 Remove CADDR1 and CMAP1. They are unused. 2004-04-03 21:38:20 +00:00
Alan Cox
121230a40d In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it
should not.  Add a new parameter so that the caller can specify which is
the case.

Reported by:	dillon
2004-04-03 09:16:27 +00:00
John Baldwin
e43257aa7d Finish fixing up Alpha to work with an MP safe ptrace():
- ptrace_single_step() is no longer called with the proc lock held, so
  don't try to unlock it and then relock it.
- Push Giant down into proc_rwmem() instead of forcing all the consumers
  (including Alpha breakpoint support) to explicitly wrap calls to
  proc_rwmem() with Giant.

Tested by:	kensmith
2004-04-01 20:56:44 +00:00
Bruce M Simpson
d25901b5da MFi386: Use the BSD madvise() syscall implementation for Linux binary
emulation, instead of treating it as an unimplemented syscall.

Requested by:	marcel
2004-03-29 02:19:43 +00:00
Ken Smith
24b5b08280 MFi386: correctly calculate the top-of-stack when a kthread is created
with a larger kernel stack. Remove inclusion of opt_kstack_pages.h now
that it's unused.

Note: If anyone's toes got stepped on by me doing this let me know
privately please.

Approved by:	rwatson (mentor)
2004-03-29 02:01:42 +00:00
John Baldwin
fafb7a586b Enable interrupt preemption on Alpha. Previously, flipping this switch on
caused hangs on SMP systems under load.  My theory was that an interrupted
thread was migrating and returning to PAL on a different CPU and that that
caused the hangs.  To prevent this, I used the recently added sched_pin()
API to pin the interrupted thread to the CPU that received the interrupt
across ithread_schedule() to prevent migration.  This seems to have fixed
the hangs based on tests by several folks on the alpha@ list.

Tested by:	wilko, tisco, several others on alpha@
2004-03-23 22:28:16 +00:00
Alan Cox
1af1ebb84e - Add uiomove_fromphys() implementations to alpha and ia64. These only
differ trivially from amd64.
 - Correct a spelling error in a comment.
2004-03-20 21:06:20 +00:00
Marcel Moolenaar
a36bdc0606 Introduce the cpumask_t type. The purpose of the type is to create a
level of abstraction for any and all CPU mask and CPU bitmap variables
so that platforms have the ability to break free from the hard limit
of 32 CPUs, simply because we don't have more bits in an u_int. Note
that the type is not supposed to solve massive parallelism, where
the number of CPUs can be larger than the width of the widest integral
type. As such, cpumask_t is not supposed to be a compound type. If
such would be necessary in the future, we can deal with the issues
then and there. For now, it can be assumed that the type is integral
and unsigned.

With this commit, all MD definitions start off as u_int. This allows
us to phase-in cpumask_t at our leasure without breaking anything.
Once cpumask_t is used consistently, platforms can switch to wider
(or smaller) types if such would be beneficial (or not; whatever :-)

Compile-tested on: i386
2004-03-20 20:41:40 +00:00
John-Mark Gurney
4de27366d1 sync comment with i386's isa.c.. This removes a comment that is YEARS
old...
2004-03-17 21:45:55 +00:00
John Baldwin
b7e23e826c - Replace wait1() with a kern_wait() function that accepts the pid,
options, status pointer and rusage pointer as arguments.  It is up to
  the caller to copyout the status and rusage to userland if needed.  This
  lets us axe the 'compat' argument and hide all that functionality in
  owait(), by the way.  This also cleans up some locking in kern_wait()
  since it no longer has to drop locks around copyout() since all the
  copyout()'s are deferred.
- Convert owait(), wait4(), and the various ABI compat wait() syscalls to
  use kern_wait() rather than wait1() or wait4().  This removes a bit
  more stackgap usage.

Tested on:	i386
Compiled on:	i386, alpha, amd64
2004-03-17 20:00:00 +00:00
Alan Cox
90ecfebd82 Refactor the existing machine-dependent sf_buf_free() into a machine-
dependent function by the same name and a machine-independent function,
sf_buf_mext().  Aside from the virtue of making more of the code machine-
independent, this change also makes the interface more logical.  Before,
sf_buf_free() did more than simply undo an sf_buf_alloc(); it also
unwired and if necessary freed the page.  That is now the purpose of
sf_buf_mext().  Thus, sf_buf_alloc() and sf_buf_free() can now be used
as a general-purpose emphemeral map cache.
2004-03-16 19:04:28 +00:00
John Baldwin
e5592f4dd9 Regenerate. 2004-03-15 22:44:35 +00:00
John Baldwin
216db4ad00 - Mark ABI syscalls that call wait4() MP safe as recent changes to
the kernel wait4() made these all panic() implementations otherwise.
- The i386 linux_ptrace() syscall is MP safe.  Alpha was already marked
  MP safe.
2004-03-15 22:43:49 +00:00
Scott Long
11d905ecd8 Now that contigfree() does not require Giant, don't grab it in busdma. 2004-03-13 15:42:59 +00:00
Alan Cox
fcffa790e9 Retire pmap_pinit2(). Alpha was the last platform that used it. However,
ever since alpha/alpha/pmap.c revision 1.81 introduced the list allpmaps,
there has been no reason for having this function on Alpha.  Briefly,
when pmap_growkernel() relied upon the list of all processes to find and
update the various pmaps to reflect a growth in the kernel's valid
address space, pmap_init2() served to avoid a race between pmap
initialization and pmap_growkernel().  Specifically, pmap_pinit2() was
responsible for initializing the kernel portions of the pmap and
pmap_pinit2() was called after the process structure contained a pointer
to the new pmap for use by pmap_growkernel().  Thus, an update to the
kernel's address space might be applied to the new pmap unnecessarily,
but an update would never be lost.
2004-03-07 21:06:48 +00:00
Alan Cox
925d2fedf5 Remove unused declarations. (Some time ago, these variables became fields
of vm/vm.h's struct kva_md_info.)
2004-03-07 07:13:15 +00:00
Lukas Ertl
1bcf24ee9d Fix syntax errors and wrong function prototypes in several MD header
files when using non-GNUC compilers.

PR:             kern/58515
Submitted by:   Stefan Farfeleder <stefan@fafoe.narf.at>
Approved by:    grog (mentor), obrien
2004-03-05 09:19:59 +00:00
Ken Smith
ea753400f0 The previous commit fixed -current on alpha for machines with
serial console connections but not graphical consoles.  This fixes the
graphical console machines.  It leaves the initial promcons console
driver in place until a bit later in the boot sequence, delaying the
switch to the device drivers more appropriate for the machine's real
console setup.  Note we still need the delayed make_dev() for promcons,
it does not have a proper bus interface so unlike other console drivers
it will not be found later during normal device discovery.

Tested by:			sepotvin <at> videotron <dot> ca
Root cause explained by:	grehan (-current)
Approved by:			rwatson (mentor)
2004-03-01 19:19:15 +00:00
Ken Smith
653700758e Previous commit mistakenly delayed cnadd() as well as make_dev().
Testing on cluster ref machine with just delaying make_dev() seems
to work, and results in printf() output appearing sooner in boot
cycle instead of going to /dev/null.

Caught by:	bde
Pointy hat:	kensmith
Approved by:	rwatson (mentor)
2004-02-28 16:36:14 +00:00
Ken Smith
44bacdd9bc Fix -current builds on alpha. Recent changes in device handling caused
subtle problems with how alpha was handling the promcons device.  This
moves the call to make_dev() for the promcons device to a later point of
the boot-up sequence than where promcons initially gets attached, make_dev()
called during the first attach crashes due to kernel stack issues.

Reviewed by:	gallatin, marcel, phk
Discussed on:	-current@, -alpha@
Approved by:	rwatson (mentor)
2004-02-27 19:30:46 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
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.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
8e1f1df080 Device megapatch 3/6:
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.
2004-02-21 20:41:11 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
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.
2004-02-21 19:42:58 +00:00
John Baldwin
0804ed5acc Regen. 2004-02-04 22:00:44 +00:00
John Baldwin
c3b612d935 The following compat syscalls are now mpsafe: linux_getrlimit(),
linux_setrlimit(), linux_old_getrlimit(), osf1_getrlimit(),
osf1_setrlimit(), svr4_sys_ulimit(), svr4_sys_setrlimit(),
svr4_sys_getrlimit(), svr4_sys_setrlimit64(), svr4_sys_getrlimit64(),
ibcs2_sysconf(), and ibcs2_ulimit().
2004-02-04 21:57:00 +00:00
John Baldwin
91d5354a2c Locking for the per-process resource limits structure.
- struct plimit includes a mutex to protect a reference count.  The plimit
  structure is treated similarly to struct ucred in that is is always copy
  on write, so having a reference to a structure is sufficient to read from
  it without needing a further lock.
- The proc lock protects the p_limit pointer and must be held while reading
  limits from a process to keep the limit structure from changing out from
  under you while reading from it.
- Various global limits that are ints are not protected by a lock since
  int writes are atomic on all the archs we support and thus a lock
  wouldn't buy us anything.
- All accesses to individual resource limits from a process are abstracted
  behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return
  either an rlimit, or the current or max individual limit of the specified
  resource from a process.
- dosetrlimit() was renamed to kern_setrlimit() to match existing style of
  other similar syscall helper functions.
- The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit()
  (it didn't used the stackgap when it should have) but uses lim_rlimit()
  and kern_setrlimit() instead.
- The svr4 compat no longer uses the stackgap for resource limits calls,
  but uses lim_rlimit() and kern_setrlimit() instead.
- The ibcs2 compat no longer uses the stackgap for resource limits.  It
  also no longer uses the stackgap for accessing sysctl's for the
  ibcs2_sysconf() syscall but uses kernel_sysctl() instead.  As a result,
  ibcs2_sysconf() no longer needs Giant.
- The p_rlimit macro no longer exists.

Submitted by:	mtm (mostly, I only did a few cleanups and catchups)
Tested on:	i386
Compiled on:	alpha, amd64
2004-02-04 21:52:57 +00:00
Poul-Henning Kamp
42fd931ee9 GC old unused dev_t mangling stuff. 2004-02-02 12:57:49 +00:00
Jeff Roberson
81aecdd39d - Remove local changes that leaked into my last commit.
Spotted by:	juli
2004-01-24 21:45:25 +00:00
Jeff Roberson
048ac395be - Recruit some new ULE users by making it the default scheduler in GENERIC.
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.
2004-01-24 21:38:52 +00:00
Jacques Vidrine
5864cda7c6 Add PFIL_HOOKS to the GENERIC kernel configuration, primarily so
that one can load the IPFilter module (which requires PFIL_HOOKS).

Requested by:	Many, for over a year
2004-01-24 14:59:51 +00:00
Poul-Henning Kamp
50d23be140 Add linenumber and source filename to panic(9) output.
Ideally a traceback should be printed too, any takers ?
2004-01-19 21:27:11 +00:00
Jacques Vidrine
e4dc8baa84 Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'm
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
2004-01-09 16:52:09 +00:00
John Baldwin
ed91a3d95a Comsetic tweaks: use PCPU_GET(cpumask) and CPU_ABSENT().
Tested by:	Dejan Lesjak <dejan.lesjak@ijs.si>
2004-01-07 23:00:20 +00:00
David E. O'Brien
c990f469a7 Convert to __FBSDID. 2004-01-04 23:30:47 +00:00
David Xu
51362c2d8a Make sigaltstack as per-threaded, because per-process sigaltstack state
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.
2004-01-03 23:36:31 +00:00
David Xu
a30ec4b99c Make sigaltstack as per-threaded, because per-process sigaltstack state
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
2004-01-03 02:02:26 +00:00
Mike Silbersack
ddeb5b242e Track three new sendfile-related statistics:
- 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
2003-12-28 08:57:09 +00:00
Mike Silbersack
5caf2b00f0 Move the declaration of sfbufspeak and sfbufsused to mbuf.h,
and use imax instead of max, as sfbufspeak and sfbufsused
are signed.

Submitted by:   bde
2003-12-28 01:43:22 +00:00
Mike Silbersack
5eda9873e9 Track current and peak sfbuf usage, export the values via sysctl. 2003-12-27 07:52:47 +00:00
Peter Wemm
c15e347e22 GC the unused <machine/kse.h> file. 2003-12-24 00:51:30 +00:00
Peter Wemm
bdbbbb1bb9 GC unused 'syshide' override to /dev/null. This was here to disable
the output of the namespc column.  Its functionality was removed some time
ago, but the overrides and the namespc column remained.
2003-12-24 00:32:07 +00:00
Peter Wemm
7f7866ad7a Regen (should be NOP except for rcsid) 2003-12-24 00:26:34 +00:00
Peter Wemm
bb5be17a81 GC unused namespc column and un-wrap some longer lines that now fit. 2003-12-24 00:26:09 +00:00
Peter Wemm
ff7a52b4b5 Regen (should be a NOP except for rcsid changes) 2003-12-23 03:55:06 +00:00
Peter Wemm
b368159c7f GC unused namespace column. Unwrap some long lines that now fit. 2003-12-23 03:53:21 +00:00
Peter Wemm
9b68618df0 Add an additional field to the elf brandinfo structure to support
quicker exec-time replacement of the elf interpreter on an emulation
environment where an entire /compat/* tree isn't really warranted.
2003-12-23 02:42:39 +00:00
Peter Wemm
a89ec05e3e Catch a few places where NULL (pointer) was used where 0 (integer) was
expected.
2003-12-23 02:36:43 +00:00
David E. O'Brien
a5b5101f5e Move the bktr(4) <arch>/include/ioctl_{bt848,meteor}.h files to dev/bktr
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.
2003-12-08 07:22:42 +00:00
David E. O'Brien
83eba35ee6 Catch up with i386 GENERIC rev 1.389. 2003-12-08 05:20:34 +00:00
Warner Losh
05a463a03d Ooops. These are still used by the bktr driver. David O'Brien has
plans for dealing, but I'll let him deal.

Pointy hat to: imp@
2003-12-07 06:37:32 +00:00
Warner Losh
65b4a1b917 Remote meteor driver. It hasn't compiled in over 3 years. If someone
makes it compile again, and can test it, we can restore the driver to
the tree.
2003-12-07 04:41:11 +00:00
Dag-Erling Smørgrav
bcfb4b30a7 Since the fdc driver can't autodetect the drive capacity on the Alpha,
give it a hint that fd0 is a 1440 kB drive.

PR:		alpha/59026
Approved by:	re (murray)
2003-12-05 00:57:11 +00:00
John Baldwin
b6c71225a9 Fix all users of mp_maxid to use the same semantics, namely:
1) mp_maxid is a valid FreeBSD CPU ID in the range 0 .. MAXCPU - 1.
2) For all active CPUs in the system, PCPU_GET(cpuid) <= mp_maxid.

Approved by:	re (scottl)
Tested on:	i386, amd64, alpha
2003-12-03 14:57:26 +00:00
Jeff Roberson
6315839163 - Set mp_maxid in a way that is consistent with every other arch. It is
one more than the last valid 'cpuid'.

Approved by:	re (rwatson)
2003-11-30 22:08:24 +00:00
Jeff Roberson
2d5d22656d - In db_stack_trace_cmd() bail out if we get confused about the stack.
Tested by:	kkenn
Approved by:	re (scottl)
2003-11-29 11:57:02 +00:00
John Baldwin
798a45964d - Split cpu_mp_probe() into two parts. cpu_mp_setmaxid() is still called
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)
2003-11-21 22:23:26 +00:00
Peter Wemm
0bfbe7b935 Widen the enable/disable helper function's argument in line with the
ithread_create() changes etc.  This should be mostly a NOP.
2003-11-17 06:10:15 +00:00
Alan Cox
0ec3db3072 - Remove unnecessary synchronization from sf_buf_init(). (There is only
one active CPU when sf_buf_init() is performed.)
2003-11-16 23:40:06 +00:00
Kris Kennaway
d5688560bf Fix build on alpha
Pointy hat to:	alfred
2003-11-16 21:53:05 +00:00
Alan Cox
e45db9b837 - Modify alpha's sf_buf implementation to use the direct virtual-to-
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.
2003-11-16 06:11:26 +00:00
Jeff Roberson
700249c287 - Drop the process lock before we call into ptrace_{read|write}_int or
any functions that call them.  Calling proc_rwmem() with the proc lock
   held is not safe.  Currently, we're protected from any races by Giant.
   Eventually proc_rwmem() should require the proc lock and not Giant.
2003-11-14 04:04:14 +00:00
Jeff Roberson
08569709d1 - Unlock the clock lock before calling timeout in sysbeep(). This is almost
the same code that i386/isa/clock.c uses.
2003-11-13 09:24:21 +00:00
Jeff Roberson
8865448db0 - Add the WITNESS_SKIPSPIN option to the GENERIC kernel so that users who
enable WITNESS on alphas will not get the expensive spin lock checking by
   default.  This mirrors the default config settings for i386.
2003-11-13 02:04:34 +00:00
Marcel Moolenaar
fcaa2925a9 Change the clear_ret argument of get_mcontext() to be a flags argument.
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().
2003-11-09 20:31:04 +00:00
Scott Long
eb3b7bf69f Document the lockfunc and lockfuncarg arguments to bus_dma_tag_create() in
the busdma headers.
2003-11-07 23:29:42 +00:00
John Baldwin
13b6c41b6c Regen. 2003-11-07 21:13:08 +00:00
John Baldwin
11d4f58fdd Sync MP safe flags with global syscalls.master for the first time. This
includes read(), write(), close(), setuid(), getuid(), linux_ptrace(),
linux_kill(), setpgid(), dup(), pipe(), getgid(), osf1_sigprocmask(),
umask(), getpgrp(), linux_setgroups(), linux_getgroups(), dup2(),
setpriority(), osf1_sigreturn(), osf1_sigsuspend(), osf1_gettimeofday(),
setreuid(), setregid(), setgid(), setsid(), osf1_sigaction(), getpgid(),
linux_getsid(), osf1_sysinfo(), linux_clone(), mlock(), munlock(),
mlockall(), munlockall(), sched_setparam(), sched_getparam(),
linux_sched_setscheduler(), linux_sched_getscheduler(),
linux_sched_get_priority_max(), linux_sched_get_priority_min(),
setresuid(), getresuid(), linux_rt_sigaction(), linux_rt_sigprocmask(),
linux_rt_sigsuspend(), gettimeofday(), linux_getitimer(),
linux_setitimer(), getrusage(), setresgid(), getresgid().
2003-11-07 21:09:19 +00:00
John Baldwin
a2f10724b5 Regen. 2003-11-07 20:56:54 +00:00
John Baldwin
bc7e0ea5ec Sync up with global syscalls.master for MP safe syscalls for the first
time.  This includes read(), write(), close(), getpid(), osf1_setuid(),
getuid(), osf1_kill(), setpgid(), dup(), pipe(), getgid(),
osf1_sigprocmask(), getlogin(), setlogin(), osf1_sigpending(), umask(),
getpgrp(), getgroups(), setgroups(), osf1_setpgrp(), getdtablesize(),
dup2(), setpriority(), getpriority(), osf1_sigreturn(), osf1_sigsuspend(),
osf1_osigstack(), setreuid(), setregid(), osf1_setgid(), setsid(),
osf1_sigaction(), msgctl(), msgget(), msgrcv(), msgsnd(), __semctl(),
semget(), semop(), shmat(), shmctl(), shmdt(), shmget(), osf1_signal(),
getpgid(), getsid(), osf1_sigaltstack(), osf1_sysinfo().
2003-11-07 20:56:31 +00:00
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
Brooks Davis
52820ec247 style: strcmp() does not return a bool. 2003-10-30 23:00:15 +00:00
Peter Wemm
1b03813f65 Add a stub cpu_idle() function for sparc64, alpha, powerpc. This is a
MI declared function so it should be everywhere.
2003-10-19 02:36:07 +00:00
Robert Drehmel
ea924c4cd3 Implement preliminary support for the PT_SYSCALL command to ptrace(2). 2003-10-09 10:17:16 +00:00
Bruce M Simpson
2bc7dd5661 Move pmap_resident_count() from the MD pmap.h to the MI pmap.h.
Add a definition of pmap_wired_count().
Add a definition of vmspace_wired_count().

Reviewed by:	truckman
Discussed with:	peter
2003-10-06 01:47:12 +00:00
Alan Cox
566526a957 Migrate pmap_prefault() into the machine-independent virtual memory layer.
A small helper function pmap_is_prefaultable() is added.  This function
encapsulate the few lines of pmap_prefault() that actually vary from
machine to machine.  Note: pmap_is_prefaultable() and pmap_mincore() have
much in common.  Going forward, it's worth considering their merger.
2003-10-03 22:46:53 +00:00
Poul-Henning Kamp
3f99f14bf1 OK, I messed up /dev/console with what I had hoped would be compat
code.  Convert remaining console drivers and hope for the best.
2003-09-26 19:35:50 +00:00
Poul-Henning Kamp
d31593c1a5 Initialize cn_name instead of cn_dev 2003-09-26 10:53:29 +00:00
Peter Wemm
c460ac3a00 Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bit
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.
2003-09-25 01:10:26 +00:00
Yoshihiro Takahashi
33e38a2cc8 Implement the bus_space_map() function to allocate resources and initialize
a bus_handle, but currently it does only initializing a bus_handle.
2003-09-23 08:22:34 +00:00
Joerg Wunsch
9678710b1f Mention the puc(4) glue driver in a commented-out example so the user
of "dumb" PCI-based serial/parallel boards get a hint how to enable
them.

I wasn't sure about the ia64, pc98, powerpc, and sparc64 archs whether
they'd support puc(4) or not.
2003-09-19 20:04:55 +00:00
Alan Cox
b9850eb224 Add a new parameter to pmap_extract_and_hold() that is needed to eliminate
Giant from vmapbuf().

Idea from:	tegge
2003-09-12 07:07:49 +00:00
Alan Cox
ba2157f218 Introduce a new pmap function, pmap_extract_and_hold(). This function
atomically extracts and holds the physical page that is associated with the
given pmap and virtual address.  Such a function is needed to make the
memory mapping optimizations used by, for example, pipes and raw disk I/O
MP-safe.

Reviewed by:	tegge
2003-09-08 02:45:03 +00:00
Alan Cox
5d314346f5 MFamd64/i386
Add necessary page locking to pmap_mincore().
2003-09-07 20:02:38 +00:00
Marcel Moolenaar
a91af2c44b Fix build breakage caused by the inclusion of <ddb/ddb.h> while
building a module. Inclusion of option files (opt_ddb.h in this
case) is not possible for modules. The inclusion of opt_ddb.h
in this header is questionable.
2003-09-07 05:33:46 +00:00
Alexander Kabaev
1d49585050 Standardize idempotentcy ifdefs. Consistently use _MACHINE_VARARGS_H_
symbol.
2003-09-01 03:01:45 +00:00
Alan Cox
411d10a600 Migrate the sf_buf allocator that is used by sendfile(2) and zero-copy
sockets into machine-dependent files.  The rationale for this
migration is illustrated by the modified amd64 allocator.  It uses the
amd64's direct map to avoid emphemeral mappings in the kernel's
address space.  On an SMP, the emphemeral mappings result in an IPI
for TLB shootdown for each transmitted page.  Yuck.

Maintainers of other 64-bit platforms with direct maps should be able
to use the amd64 allocator as a reference implementation.
2003-08-29 20:04:10 +00:00
Alan Cox
5d167c620a Eliminate the direct uses of vm_page_lookup() on the pte object. Instead,
apply PHYS_TO_VM_PAGE() to the physical address obtained from the page
table.

(This is based upon similar changes made to the amd64 and i386 pmaps and
a part of a long-term campaign to eliminate pte objects.)

Tested by:	wilko
2003-08-28 23:12:28 +00:00
Marcel Moolenaar
875e2e9ca9 Add option NO_SIO to work-around the hardcoded dependency on sio(4).
Without this option it is not possible to omit the driver from the
configuration file and successfully build a kernel.

This option is specific to alpha.
2003-08-25 03:43:08 +00:00
Warner Losh
19b7ffd1b8 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 07:20:27 +00:00
Alan Cox
c603549f15 - Lock the pte object when performing vm_page_grab().
- Insure that the page table page is zero filled before adding it
   to the page table.
2003-08-20 20:12:05 +00:00
Gordon Tetlow
df3d69c217 Fixup the ELF branding information to point to the new home of rtld. 2003-08-17 08:08:38 +00:00
Marcel Moolenaar
3e25ce2310 Cleanup <machine/cpu.h> by moving MD prototypes to <machine/md_var.h>
like we have on other platforms. Move savectx() to <machine/pcb.h>.
A lot of files got these MD prototypes through the indirect inclusion
of <machine/cpu.h> and now need to include <machine/md_var.h>. The
number of which is unexpectedly large...

osf1_misc.c especially is tricky because szsigcode is redefined in
one of the osf1 header files. Reordering of the include files was
needed.

linprocfs.c now needs an explicit extern declaration.

Tested with: LINT
2003-08-17 06:42:08 +00:00
Marcel Moolenaar
710338e94f In vm_thread_swap{in|out}(), remove the alpha specific conditional
compilation and replace it with a call to cpu_thread_swap{in|out}().
This allows us to add similar code on ia64 without cluttering the
code even more.
2003-08-16 23:15:15 +00:00
Marcel Moolenaar
26502503e5 Further cleanup <machine/cpu.h> and <machine/md_var.h>: move the MI
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)
2003-08-16 16:57:57 +00:00