games.git
17 years agoMerge from vendor branch BZIP:
Peter Avalos [Sat, 20 Jan 2007 05:57:40 +0000 (05:57 +0000)]
Merge from vendor branch BZIP:
Update to bzip2-1.0.4.

17 years agoUpdate to bzip2-1.0.4.
Peter Avalos [Sat, 20 Jan 2007 05:57:40 +0000 (05:57 +0000)]
Update to bzip2-1.0.4.

17 years agoUpdate to bzip2-1.0.4.
Peter Avalos [Sat, 20 Jan 2007 05:57:40 +0000 (05:57 +0000)]
Update to bzip2-1.0.4.

17 years agoAdd DPADD lines for used libs.
Simon Schubert [Sat, 20 Jan 2007 03:51:33 +0000 (03:51 +0000)]
Add DPADD lines for used libs.

17 years agoFix internal compiler errors with propolice enabled.
Simon Schubert [Sat, 20 Jan 2007 03:16:33 +0000 (03:16 +0000)]
Fix internal compiler errors with propolice enabled.

Obtained-from: Gentoo/Kevin F. Quinn <kevinquinn@gentoo.org>/Gentoo Bug #74457

17 years agoFix a hang during boot.
YONETANI Tomokazu [Fri, 19 Jan 2007 23:58:53 +0000 (23:58 +0000)]
Fix a hang during boot.
MaxDepth argument to AcpiOsCacheCreate() is `maximum number of
unallocated objects', not `maximum number of allocatable objects'.
This resulted in what seemed to be a hang if the number of objects
in a cache exceeded ACPI_MAX_*_CACHE_DEPTH(currently 96).

Tracked-down-by: Simon 'corecode' Schubert <corecode at fs.ei.tum.de>
Tested-by: Johannes Hofmann <Johannes.Hofmann at gmx.de>
17 years agoRework the make rule for patched *.c files.
YONETANI Tomokazu [Fri, 19 Jan 2007 19:18:09 +0000 (19:18 +0000)]
Rework the make rule for patched *.c files.
Previously ${SRCS} contained the file name with and without
the directory part(hardware/hwsleep.c vs hwsleep.c), and
the object files from the latter are trimmed off of ${OBJS}.
This resulted in compiling both patched and unpatched version
and the object files get created under ${.OBJDIR}.
Also make a patched *.c file depend on the patch, so as the
*.c file is re-generated when the patch is updated.

17 years agoAcpiTbDeleteTable() now takes a (ACPI_TABLE_DESC *) as its argument,
YONETANI Tomokazu [Fri, 19 Jan 2007 16:41:28 +0000 (16:41 +0000)]
AcpiTbDeleteTable() now takes a (ACPI_TABLE_DESC *) as its argument,
not the index of the table to delete.

17 years agoComplain if CPUTYPE is set to an unknown value.
Simon Schubert [Fri, 19 Jan 2007 10:38:59 +0000 (10:38 +0000)]
Complain if CPUTYPE is set to an unknown value.

17 years agoFix handling of MACHINE_CPU.
Simon Schubert [Fri, 19 Jan 2007 10:38:38 +0000 (10:38 +0000)]
Fix handling of MACHINE_CPU.

17 years agoDocument -U.
Sascha Wildner [Fri, 19 Jan 2007 08:13:44 +0000 (08:13 +0000)]
Document -U.

17 years agoRename /usr/src/sys/machine to /usr/src/sys/platform. Give the platform
Matthew Dillon [Fri, 19 Jan 2007 07:23:43 +0000 (07:23 +0000)]
Rename /usr/src/sys/machine to /usr/src/sys/platform.  Give the platform
name its own variable, MACHINE_PLATFORM, instead of trying to use MACHINE
to name it.  Adjust the build infrastructure to match.

Revert MACHINE back to its original definition and remove uname shims.
This removes confusion with third party software.

This means a pc32 build has MACHINE=i386 and MACHINE_ARCH=i386, and a
vkernel build also has MACHINE=i386 and MACHINE_ARCH=i386.  The new
MACHINE_PLAFORM would be pc32 for a pc32 build, and vkernel for a vkernel
build.

Adjust all kernel configuration files to specify platform, machine, AND
machine_arch.

17 years agoFix negation handling.
Simon Schubert [Thu, 18 Jan 2007 17:03:18 +0000 (17:03 +0000)]
Fix negation handling.

Previously, constructs involving && or || and a pipe would fail if the
first element was negated, like  true && ! true | false.  FreeBSD and
NetBSD did several rounds of fixes, each fixing special cases, however
those fixes failed to correct the real problem.  We now *always* process
the negation (!) *only* in pipes.

17 years agoFix a stack reference bug and do a cleanup.
Victor Balada Diaz [Thu, 18 Jan 2007 12:34:46 +0000 (12:34 +0000)]
Fix a stack reference bug and do a cleanup.

Reported-By: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Bug-ID: Issue518
Commited-On-Behalf-Of: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>

17 years agoPut socket() declaration into __{BEGIN,END}_DECL, so c++ compiler
Sepherosa Ziehau [Thu, 18 Jan 2007 11:46:32 +0000 (11:46 +0000)]
Put socket() declaration into __{BEGIN,END}_DECL, so c++ compiler
can see the correct fucntion name.

Reported-by: walt <wa1ter@myrealbox.com>
17 years agoTeach rcs utils about commitid phrase.
YONETANI Tomokazu [Wed, 17 Jan 2007 17:56:24 +0000 (17:56 +0000)]
Teach rcs utils about commitid phrase.

NOTE: commands don't emit the phrase into RCS files unless you compile
      them with RCS_EMIT_COMMITID=yes.

Taken-from: contrib/rcs-5.7-commitid.patch which came with cvs-1.12.13

17 years agoUpdate ACPI build wrappers to use new ACPI-CA code.
YONETANI Tomokazu [Wed, 17 Jan 2007 17:31:20 +0000 (17:31 +0000)]
Update ACPI build wrappers to use new ACPI-CA code.
* many fixes in ACPI-CA code (see changes.txt for detail)

* enable interpreter slack code
  relaxed checking on AML code to get fewer warnings

* use OS implementation of spinlock and cache object:
  OSL cache code by:
  Jeffrey Hsu <hsu@dragonflybsd.org>
  Fix to semaphore and locking code:
  Simon 'corecode' Schubert <corecode@fs.ei.tum.de>

* added a few debugging knobs(on make command line):
  ACPI_DEBUG_LOCKS=yes to activate debugging code for AcpiOs*Lock()
  ACPI_DEBUG_MEMMAP=yes to activate debugging code for AcpiOs*MapMemory()

17 years agoMerge from vendor branch INTEL_ACPICA:
YONETANI Tomokazu [Wed, 17 Jan 2007 16:29:46 +0000 (16:29 +0000)]
Merge from vendor branch INTEL_ACPICA:
Import acpica-unix-20061109 from Intel.

17 years agoImport acpica-unix-20061109 from Intel. chlamydia/vendor/INTEL_ACPICA crater/vendor/INTEL_ACPICA origin/vendor/INTEL_ACPICA
YONETANI Tomokazu [Wed, 17 Jan 2007 16:29:46 +0000 (16:29 +0000)]
Import acpica-unix-20061109 from Intel.

17 years agoDon't use 'kenv' as default .Nm.
Thomas E. Spanjaard [Wed, 17 Jan 2007 13:17:31 +0000 (13:17 +0000)]
Don't use 'kenv' as default .Nm.

Reported-by: Sascha Wildner <saw@online.de>

17 years agoRemove gcc40 remains.
Sascha Wildner [Wed, 17 Jan 2007 12:09:42 +0000 (12:09 +0000)]
Remove gcc40 remains.

17 years agoChange the synopsis from ipnumber to ip-list
Victor Balada Diaz [Wed, 17 Jan 2007 10:37:48 +0000 (10:37 +0000)]
Change the synopsis from ipnumber to ip-list

Reported-by: corecode
17 years ago* Add documentation for -I and add an example for network setup.
Sascha Wildner [Wed, 17 Jan 2007 08:44:32 +0000 (08:44 +0000)]
* Add documentation for -I and add an example for network setup.

* Show the -e option's argument format in the SYNOPSIS instead of explaining
  it in the text.

* Add -DNO_MODULES to the buildkernel example.

* Add some more references to SEE ALSO.

* Fix a typo.

Thanks to sephe for advice regarding -I.

17 years agoCast sentinel for execl() to (char *) to quiet gcc4 warning.
Peter Avalos [Wed, 17 Jan 2007 02:34:10 +0000 (02:34 +0000)]
Cast sentinel for execl() to (char *) to quiet gcc4 warning.

17 years agoUse genassym to create target symbols instead of
Simon Schubert [Wed, 17 Jan 2007 02:17:36 +0000 (02:17 +0000)]
Use genassym to create target symbols instead of
rolling a non-cross-safe version.

17 years agoAdd SYSCTLS, FILES and BUGS sections to kenv.9, and misc cleanups.
Thomas E. Spanjaard [Tue, 16 Jan 2007 19:34:54 +0000 (19:34 +0000)]
Add SYSCTLS, FILES and BUGS sections to kenv.9, and misc cleanups.

17 years agoAdd missing -I path when compiling assembly files.
Matthew Dillon [Tue, 16 Jan 2007 18:38:08 +0000 (18:38 +0000)]
Add missing -I path when compiling assembly files.

17 years agoAdd missing #endif.
Sascha Wildner [Tue, 16 Jan 2007 09:58:02 +0000 (09:58 +0000)]
Add missing #endif.

Reported-by: Petr Janda <elekktretterr@exemail.com.au>
17 years agos/. Ar/.Ar/
Sascha Wildner [Tue, 16 Jan 2007 07:49:57 +0000 (07:49 +0000)]
s/. Ar/.Ar/

17 years agoImplement getcontext(), setcontext(), makecontext(), and swapcontext().
Matthew Dillon [Tue, 16 Jan 2007 07:16:23 +0000 (07:16 +0000)]
Implement getcontext(), setcontext(), makecontext(), and swapcontext().

This is a preliminary libc-only implementation.  sigprocmask() is used
to mask signals during the context switch and to save and restore signals.
FP registers are not currently saved or restored - that is, synchronous
use is intended.

Submitted-by: "Matt Emmerton" <matt@gsicomp.on.ca>
Finished-up-by: "Matthew Dillon" <dillon@backplane.com>
17 years agoAlso build+install csu in the world stage.
Simon Schubert [Mon, 15 Jan 2007 23:09:05 +0000 (23:09 +0000)]
Also build+install csu in the world stage.

17 years agoRemove build glue of gcc40.
Simon Schubert [Mon, 15 Jan 2007 23:07:37 +0000 (23:07 +0000)]
Remove build glue of gcc40.

17 years agoCorrect the DragonFly version of first appearance from 1.8 to 1.7.
Thomas E. Spanjaard [Mon, 15 Jan 2007 22:42:55 +0000 (22:42 +0000)]
Correct the DragonFly version of first appearance from 1.8 to 1.7.

Reported-by: Simon Schubert <corecode@fs.ei.tum.de>

17 years agoAdd a manual page in section 9 for the recently added kernel environment
Thomas E. Spanjaard [Mon, 15 Jan 2007 22:08:03 +0000 (22:08 +0000)]
Add a manual page in section 9 for the recently added kernel environment
support functions, as well as the existing ones.

Minor nit: the Makefile's MAN entries haven't been sorted in a while...

17 years agoWe want the virtual kernel to be default-secure. Disable writes to kernel
Matthew Dillon [Mon, 15 Jan 2007 20:51:16 +0000 (20:51 +0000)]
We want the virtual kernel to be default-secure.  Disable writes to kernel
memory and disable module loading by default when running a virtual kernel.
Run the virtual kernel with the -U option (for Unsecure) to run with these
enabled.

Reads are still allowed since the virtual kernel's memory does not
contain any compromising data from the real kernel.

17 years agocputimer_intr_reload() - prevent a negatively indexed or too-small a reload
Matthew Dillon [Mon, 15 Jan 2007 19:08:10 +0000 (19:08 +0000)]
cputimer_intr_reload() - prevent a negatively indexed or too-small a reload
value from loading the kqueue timer with an illegal value.

17 years agoRemove traces of gcc40
Simon Schubert [Mon, 15 Jan 2007 18:29:44 +0000 (18:29 +0000)]
Remove traces of gcc40

17 years agoRetire gcc-4.0.
Simon Schubert [Mon, 15 Jan 2007 18:23:24 +0000 (18:23 +0000)]
Retire gcc-4.0.

17 years agoCreate startup files from the GCC sources and drop our versions.
Simon Schubert [Mon, 15 Jan 2007 18:01:44 +0000 (18:01 +0000)]
Create startup files from the GCC sources and drop our versions.
This places the startup files into the GCC specific lib dir.  A short
overview is given in lib/csu/README.

This fixes issues with gcc41 and static binaries.

17 years agoCopy forgotten header from gcc34 build glue
Simon Schubert [Mon, 15 Jan 2007 17:53:16 +0000 (17:53 +0000)]
Copy forgotten header from gcc34 build glue

17 years agoReorder libs to allow -DNOSHARED linkage
Simon Schubert [Mon, 15 Jan 2007 17:51:23 +0000 (17:51 +0000)]
Reorder libs to allow -DNOSHARED linkage

17 years agoSync with FreeBSD.
Sascha Wildner [Mon, 15 Jan 2007 15:27:11 +0000 (15:27 +0000)]
Sync with FreeBSD.

17 years agocrtstuff.c is now present
Simon Schubert [Mon, 15 Jan 2007 14:46:54 +0000 (14:46 +0000)]
crtstuff.c is now present

17 years agoMerge from vendor branch GCC:
Simon Schubert [Mon, 15 Jan 2007 14:46:13 +0000 (14:46 +0000)]
Merge from vendor branch GCC:
Import crt code from gcc-4.1.1

17 years agoImport crt code from gcc-4.1.1
Simon Schubert [Mon, 15 Jan 2007 14:46:13 +0000 (14:46 +0000)]
Import crt code from gcc-4.1.1

17 years agoDo not lookup symbols with STB_LOCAL binding
Simon Schubert [Mon, 15 Jan 2007 14:38:22 +0000 (14:38 +0000)]
Do not lookup symbols with STB_LOCAL binding

When a shared object with static TLS symbols gets linked, ld issues
a R_386_TLS_DTPMAP32 relocation on i386, referencing symbol 0, the
undefined symbol.  This is perfectly legal, as this is simply a
local symbol and nothing but the local module's TLS index is needed.

This fixes execution of binaries linked to gcc41's libstdc++.

Obtained-from: FreeBSD

17 years agoBy default do not enable hardware csum on PCIe re(4), which trashes
Sepherosa Ziehau [Mon, 15 Jan 2007 12:53:26 +0000 (12:53 +0000)]
By default do not enable hardware csum on PCIe re(4), which trashes
packets intermittently if csum offload is enabled.  This problem does
not seem to plague PCI re(4).

The pattern of trashed packets is not yet identified.  From the tcpdump
information provided by Joe, the packets' size should not be the direct
cause.  Hardware bug?

Reported-by: Joe Talbott <josepht@cstone.net> (RTL8101E, PCIe re(4))
# Same problem is reported to FreeBSD by two RTL8168B(PCIe re(4)) users.

17 years agoClose two holes in the pmap code. The page table self mapping does not
Matthew Dillon [Mon, 15 Jan 2007 09:28:40 +0000 (09:28 +0000)]
Close two holes in the pmap code.  The page table self mapping does not
necessarily stay valid through a blocking condition, recheck it for every
page.  The 'next' pointer in the loop that runs through PV entries is not
safe when code blocks in the loop.  Add a generation count to detect
unexpected removals and restart the loop.  Add a kprintf() to print when
the condition is detected.

Crash-Reported-by: Nuno Antunes <bugs@crater.dragonflybsd.org>
17 years agoPass an interrupt frame to kqueue-based interrupts. Modify the console
Matthew Dillon [Mon, 15 Jan 2007 05:27:31 +0000 (05:27 +0000)]
Pass an interrupt frame to kqueue-based interrupts.  Modify the console
and the systimer subsystems to use kqueue interrupts.  Use EV_CLEAR for
all kqueue elements.

17 years agoDo not use dbg() too soon. This fixes rtld with -DDEBUG.
Simon Schubert [Mon, 15 Jan 2007 04:45:40 +0000 (04:45 +0000)]
Do not use dbg() too soon.  This fixes rtld with -DDEBUG.

Obtained-from: FreeBSD

17 years agoAdd kqueue based async I/O support to the virtual kernel. Convert VKE to
Matthew Dillon [Mon, 15 Jan 2007 01:29:04 +0000 (01:29 +0000)]
Add kqueue based async I/O support to the virtual kernel.  Convert VKE to
use the new async I/O support for reading.

Setup SIGIO as a SA_MAILBOX signal for efficiency.  Remove remaining signal
masks from sigaction() calls.

17 years agoAdd O_ASYNC (SIGIO) support to kqueue(). Also add F_SETOWN support.
Matthew Dillon [Mon, 15 Jan 2007 01:26:56 +0000 (01:26 +0000)]
Add O_ASYNC (SIGIO) support to kqueue().  Also add F_SETOWN support.

17 years agoAdd KQUEUE support to the TAP interface.
Matthew Dillon [Mon, 15 Jan 2007 00:51:43 +0000 (00:51 +0000)]
Add KQUEUE support to the TAP interface.

17 years agoRename type to avoid conflict with 'kqueue' symbol.
Matthew Dillon [Mon, 15 Jan 2007 00:11:36 +0000 (00:11 +0000)]
Rename type to avoid conflict with 'kqueue' symbol.

17 years agoLink up the interrupt frame to the systimer API. Use PGEX_U to indicate
Matthew Dillon [Sun, 14 Jan 2007 20:07:15 +0000 (20:07 +0000)]
Link up the interrupt frame to the systimer API.  Use PGEX_U to indicate
a user frame and adjust CLKF_USERMODE for the virtual kernel.  This allows
the stat clock in the virtual kernel to account for user vs system time
(instead of just counting it all as system time).

Consolidate other special virtual kernel and signal flags in tf_xflags and
name them the same (FPEX_FAULT -> PGEX_FPFAULT, and add PGEX_MAILBOX)

Implement PGEX_MAILBOX for signal frames.  On signal return this flag causes
P_MAILBOX to be set in order to maintain interlock semantics with mailbox
signals.

17 years agoSuppress the error message for command -v for files with a slash.
Peter Avalos [Sun, 14 Jan 2007 18:14:39 +0000 (18:14 +0000)]
Suppress the error message for command -v for files with a slash.

Obtained-from:  FreeBSD

17 years agoUse volatile where appropriate.
Peter Avalos [Sun, 14 Jan 2007 17:29:58 +0000 (17:29 +0000)]
Use volatile where appropriate.

Partially taken from NetBSD.

17 years agoMechanically kill hard sentence breaks.
Peter Avalos [Sun, 14 Jan 2007 16:30:20 +0000 (16:30 +0000)]
Mechanically kill hard sentence breaks.

Fix references to non-existing or obsoleted man pages.

Use ``.Pq Ql'' to quote single characters, instead of ``.Pq Li''.
This makes the resulting output more aesthetically pleasing in
text-only terminals.

mdoc cleanups.

Add missed '.'.

Document that '#' starts a comment.

o Discuss the ways to escape an alias.
o Fix the alias syntax lines.
o Refer to the Aliases subsection.

Document that `in word ...' is optional in the for command.

Document the "return" built-in better: it will exit . (sources) and
the top-level shell instance, too.

When listing the special $ variables, ($!, $#, etc) list them as $!
instead of just !, this allows one to more easily locate/understand
the section of the manpage in question.

Document the -L and -P options to the cd and pwd commands as being
mutually exclusive.

Document command -v and -V.

Split the export synopsis into two lines as -p cannot be mixed with variable
names.

Document the fact that 'true' and 'false' are among sh(1) built-in commands.

- Move the description of the ``-c string'' option closer to the option itself.
- Add an ENVIRONMENT section (1)
- Add more .Xr cross references to the SEE ALSO section.

Add `local' and `return' to the list of built-ins.

Document that read -t timeout returns 1 if the timeout elapses.

Make it easier to find that we have test(1) built-in in sh(1).

- Document trap's -l option and the behaviour of a missing action or a single
  dash.
- Discourage the omission of the action.

Document umask's -S option.

Tell more of the sh(1) history.
Acknowledge Kenneth Almquist's contribution in AUTHORS.

Document missing multibyte character handling in utilities specified
by POSIX.

Obtained-from:  FreeBSD

17 years agoSpelling fix.
Peter Avalos [Sun, 14 Jan 2007 15:16:49 +0000 (15:16 +0000)]
Spelling fix.

Obtained-from:  FreeBSD

17 years agoSpelling errors.
Peter Avalos [Sun, 14 Jan 2007 15:14:52 +0000 (15:14 +0000)]
Spelling errors.

POSIX demands that set's output (when invoked without arguments) should be
sorted.  Sort the variables before printing.

Provide a reasonable error message for `export -p var'.
Use argv rather than argptr since getopt() is used here.

Obtained-from:  FreeBSD

17 years ago- Add multi pseudo network interface support for vkernel
Sepherosa Ziehau [Sun, 14 Jan 2007 14:24:56 +0000 (14:24 +0000)]
- Add multi pseudo network interface support for vkernel
- Add two sysctl for vke(4):
  o  hw.vkeX.intr_rate -- pseudo interrupt rate
  o  hw.vkeX.tap_unit  -- backend real kernel tap(4) interface unit
- Print backend tap(4) interface name in vkernel for 'ifconfig vkeX'

vke(4)s are created according to the following command line option:

-I tap_devname[:expression]

'tap_devname' can be:
1) auto                pick up the first unused tap(4) device file in /dev
2) tapX                use /dev/tapX as tap(4) device file
3) /path/to/tap_dev    use /path/to/tap_dev as tap(4) device file

'expression' is optional and could be:
1) x.x.x.x             tap(4)'s address is x.x.x.x

2) x.x.x.x/z           tap(4)'s address is x.x.x.x
                       tap(4)'s netmask len is z

3) x.x.x.x:y.y.y.y     tap(4)'s address is x.x.x.x
                       vke(4)'s address is y.y.y.y

4) x.x.x.x:y.y.y.y/z   tap(4)'s address is x.x.x.x
                       vke(4)'s address is y.y.y.y
                       tap(4) and vke(4)'s netmask len are z

5) bridgeX             tap(4) will be added to bridgeX

6) bridgeX:y.y.y.y     tap(4) will be added to bridgeX
                       vke(4)'s address is y.y.y.y

7) bridgeX:y.y.y.y/z   tap(4) will be added to bridgeX
                       vke(4)'s address is y.y.y.y
                       vke(4)'s netmask len is z

vke(4)'s unit will be in the same order as the -I command line option,
i.e. first -I option will create vke0, and the second -I option will
create vke1 etc...

If vke(4)'s address/netmask is supplied, then in vkernel 'ifconfig vkeX up'
will assign the supplied address/netmask to vkeX in addition to bringing
vkeX up.

NOTE:
1) bridgeX will not be created if it does not exist yet
2) bridgeX will not be brought up if it is not up yet
3) if_tap.ko and if_bridge.ko will not be loaded automaticly
The main reason for 1) and 2), is that bridgeX will be in its original
state when vkernel is stopped normally or abruptly.

So if you choose to utilize bridged tap(4), before starting vkernel, you
will have to do following to make vke(4) work (suppose we use re0 as real
network interface):
# kldload if_bridge.ko
# kldload if_tap.ko
# ifconfig re0 up
# ifconfig bridge0 create
# ifconfig bridge0 addm re0
# ifconfig bridge0 up

Approved-by: dillon@
17 years agoExpose socket() function declaration for vkernel too.
Sepherosa Ziehau [Sun, 14 Jan 2007 14:19:57 +0000 (14:19 +0000)]
Expose socket() function declaration for vkernel too.

17 years ago* Add documentation for -s.
Sascha Wildner [Sun, 14 Jan 2007 10:43:32 +0000 (10:43 +0000)]
* Add documentation for -s.

* Move the configuaration examples to an EXAMPLES section and model the
  setup of the root image file after the setup instructions given in
  jail(8) (i.e., use 'installworld' and 'distribution' instead of
  cpdup'ing the host system's /). Add some lines for setting up simple
  /etc/fstab and /etc/ttys files.

* Add some references to SEE ALSO.

* Minor mdoc additions/cleanup

TODO: document -I

17 years agoSync names of fs modules with what's really there.
Sascha Wildner [Sun, 14 Jan 2007 09:43:22 +0000 (09:43 +0000)]
Sync names of fs modules with what's really there.

Reported-by: Jeremy C. Reed <reed@reedmedia.net>
17 years agoImplement a new signal delivery mechanism, SA_MAILBOX. If specified the
Matthew Dillon [Sun, 14 Jan 2007 07:59:09 +0000 (07:59 +0000)]
Implement a new signal delivery mechanism, SA_MAILBOX.  If specified the
sigaction structure's sa_mailbox pointer (field is unioned with sa_handler)
points to a location in user memory.  When the signal occurs, the location
is overwritten with the signal number and the next system call made (or
the current one running) will return EINTR.  NO SIGNAL STATE IS PUSHED,
NO SIGNAL VECTOR IS DISPATCHED.  This makes mailbox signaling very fast.

Userland can interlock against the mailbox simply by polling and clearing
the mailbox prior to doing a system call.  The mailbox signal will be
properly interlocked against the system call.  Userland does not need to
make any other system calls (no sigblock() or sigsetmask() calls) to
properly interlock delivery.  The kernel interrupts at most one system call
per signal delivered via this mechanism, even if the userland does not
clear the mailbox.

As of this implementatino, mailbox delivery can cause an extra 'false'
interruption of a system call.  system calls do not currently poll installed
mailboxes to deal with false hits.  Mailbox signaling is meant to be used
under tightly managed conditions.

Move the virtual kernel check from sendsig() to postsig().  Mailbox
delivery must do any virtual kernel swaps prior to posting a mailbox signal.

Adjust go_user() to take an interrupt frame instead of a trap frame.

Replace the sigblock() based idle loop interlock with a mailbox interlock.
Add mailbox checks to the go_user() vmspace_ctl() loop (currently a bit of
a hack).

17 years ago- Invoke ifnet_attach_event when open tap(4) device file, for which the
Sepherosa Ziehau [Sun, 14 Jan 2007 07:25:59 +0000 (07:25 +0000)]
- Invoke ifnet_attach_event when open tap(4) device file, for which the
  corresponding tap(4) interface have already been created
- Add missing rt_ifannouncemsg(IFAN_{ARRIVAL,DEPARTURE})
- Correct SIOCSIFFLAGS ifnet.if_ioctl() support for non-vmnet tap(4):
  Call ifnet.if_init(), i.e. tapifinit(), when IFF_UP is in ifnet.if_flags
  but IFF_RUNNING is missing

17 years agoWhitespace nits.
Peter Avalos [Sun, 14 Jan 2007 06:38:27 +0000 (06:38 +0000)]
Whitespace nits.

Correctly quote the output when showing the installed trap actions.

Fix an operator precedence style error.

Wrap lines at 80 columns.

Obtained-from:  FreeBSD

17 years agoOutput something reasonable for regular and expanded here-documents.
Peter Avalos [Sun, 14 Jan 2007 06:21:52 +0000 (06:21 +0000)]
Output something reasonable for regular and expanded here-documents.

Remove extra getenv() declaration.

Include missing headers to get prototypes.

Remove dead code which supported systems without O_APPEND, O_CREAT or SIGTSTP.

Obtained-from:  FreeBSD

17 years agoReplace home-grown dup2() implementation with actual dup2() calls.
Peter Avalos [Sun, 14 Jan 2007 05:48:08 +0000 (05:48 +0000)]
Replace home-grown dup2() implementation with actual dup2() calls.

Obtained-from:  FreeBSD

17 years agoDo not forget to increment the input line counter
Peter Avalos [Sun, 14 Jan 2007 05:39:22 +0000 (05:39 +0000)]
Do not forget to increment the input line counter
when reading a word spanning multiple lines.

Support \H, \h, \w, \W, \$ string expansion in the prompt.

Disallow empty condition parts of "if", "while" and "until" compound
commands.

Obtained-from:  FreeBSD

17 years agoReplace a home-grown printf() clone with a fwopen() wrapper around
Peter Avalos [Sun, 14 Jan 2007 05:12:40 +0000 (05:12 +0000)]
Replace a home-grown printf() clone with a fwopen() wrapper around
libc's vfprintf() that writes to a `struct output' instead of a file.

Print empty quotes ('') when an empty string is passed to outqstr().
This makes a difference for the trap builtin, where after "trap '' 0" we
printed "trap -- quit".  This is wrong, because an empty action means to reset
the action to the default.  A side effect of this commit is that empty
variables are now printed as "variable=''" instead of just "variable=".

Obtained-from:  FreeBSD

17 years agoInclude disabled options in the output of 'set +o'. POSIX says the output of
Peter Avalos [Sun, 14 Jan 2007 04:41:32 +0000 (04:41 +0000)]
Include disabled options in the output of 'set +o'.  POSIX says the output of
set +o can be used to reload previous settings, for this to work disabled
options must be printed as well or otherwise options that were set in the mean
time won't be turned off.

Change /bin/sh so *it* implements the processing needed for scripts to
work as expected when they have a "shebang line" of:

     #!/bin/sh -- # -*- perl -*- -p

Obtained-from:  FreeBSD

17 years agoInvoke ifnet_detach_event when close a tap(4) device file. tapclose()
Sepherosa Ziehau [Sun, 14 Jan 2007 04:02:58 +0000 (04:02 +0000)]
Invoke ifnet_detach_event when close a tap(4) device file.  tapclose()
looks much more like an network interface destruction routine than an
network interface stopping routine.

17 years agoProtect malloc, realloc and free calls with INT{ON,OFF} directly in chkalloc,
Peter Avalos [Sun, 14 Jan 2007 03:59:57 +0000 (03:59 +0000)]
Protect malloc, realloc and free calls with INT{ON,OFF} directly in chkalloc,
ckrealloc and ckfree (added), respectively.  sh jumps out of the signal handler
using longjmp which is obviously a bad idea during malloc calls.

Use the ALIGN macro from <sys/param.h> instead of defining our own
version in machdep.h. Delete machdep.h.

Obtained-from:  FreeBSD

17 years agoThe FP subsystem might not work properly when a vkernel is run inside
Matthew Dillon [Sun, 14 Jan 2007 00:01:08 +0000 (00:01 +0000)]
The FP subsystem might not work properly when a vkernel is run inside
a vkernel, but don't explicitly panic.

Move an madvise() to after a mmap() error check.

Fix a vkernel-on-vkernel bug in pmap_zero_page().  The VPTE was being
given write access without read access and this confused the parent
virtual kernel.

17 years agoAllow VKERNEL builds to build certain non-hardware disk modules as well.
Matthew Dillon [Sat, 13 Jan 2007 23:57:04 +0000 (23:57 +0000)]
Allow VKERNEL builds to build certain non-hardware disk modules as well.

17 years agoIssue an error when . (dot) is invoked without a filename.
Peter Avalos [Sat, 13 Jan 2007 23:36:14 +0000 (23:36 +0000)]
Issue an error when . (dot) is invoked without a filename.

Initialize PWD early on (don't expect it to be inherited from the
environment or set it only when changing directories with cd)

Remove some kind of profiling support that required the 4.2BSD monitor()
function in libc.

Obtained-from:  FreeBSD

17 years agoInclude the VN device by default.
Matthew Dillon [Sat, 13 Jan 2007 23:09:17 +0000 (23:09 +0000)]
Include the VN device by default.

17 years agoRemove some white space at EOL.
Peter Avalos [Sat, 13 Jan 2007 22:39:30 +0000 (22:39 +0000)]
Remove some white space at EOL.

Protect a setmode call with INT{ON,OFF} as it calls malloc internally.

Fix the error message if the mask that is passed to umask -S contains
non-digits.

Remove dead code.  Inspection of the control and data flow showed that
variable "backslash" is always false (0) when the "if"-expression is
evaluated, hence the whole block is effectively dead code.
Additionally, the skipping of characters after a backslash is already
performed correctly a few lines above, so this code is also not
needed at all.

- Don't use quad_t when we really mean rlim_t.
- Cast rlim_t to intmax_t when printing it.

Callers of error() don't need to supply a program name prefix in the
error message. Stops ulimit giving error messages like "ulimit: ulimit: xyz".

Obtained-from:  FreeBSD

17 years agoAdd options ACPI_QUIRK_VMWARE to LINT.
Thomas E. Spanjaard [Sat, 13 Jan 2007 22:26:54 +0000 (22:26 +0000)]
Add options ACPI_QUIRK_VMWARE to LINT.

17 years agoEnable the ACPI quirks kernel environment variable setting, and add a
Thomas E. Spanjaard [Sat, 13 Jan 2007 21:58:11 +0000 (21:58 +0000)]
Enable the ACPI quirks kernel environment variable setting, and add a
quirks candidate: the VMware ACPI-fast24 timer. The latter quirk setting is
guarded by a kernel config file option, options ACPI_QUIRK_VMWARE. It's
commented out in the GENERIC config file by default.

TODO:
- port FreeBSD's more extensive ACPI quirks table support, which
  allows for more specifics to discern between ACPI
  implementations.

17 years agoAdd support for a dynamic environment array in the kernel.
Thomas E. Spanjaard [Sat, 13 Jan 2007 21:33:30 +0000 (21:33 +0000)]
Add support for a dynamic environment array in the kernel.

TODO:
- implement a sysctl handler for the dynamic array;
- write a manual page.

Adapted-from: FreeBSD

17 years agoRemove some white space at EOL.
Peter Avalos [Sat, 13 Jan 2007 21:27:45 +0000 (21:27 +0000)]
Remove some white space at EOL.

Print pointers with %p rather than casting them to long.

Use the %t format modifier to print differences between pointers.

Obtained-from:  FreeBSD

17 years agoPull in a few bits from FreeBSD. Add a structure size field and floating
Matthew Dillon [Sat, 13 Jan 2007 21:15:57 +0000 (21:15 +0000)]
Pull in a few bits from FreeBSD.  Add a structure size field and floating
point management fields to the signal context and mcontext/ucontext.  These
fields will allow us to optimize the floating point save/restore in the
future.

17 years agoAdd the POSIX option -p to the jobs builtin command. It prints the PID of the
Peter Avalos [Sat, 13 Jan 2007 20:33:47 +0000 (20:33 +0000)]
Add the POSIX option -p to the jobs builtin command.  It prints the PID of the
process leader for each job.  Now the last specified option for the output
format (-l, -p or -s) wins, previously -s trumped -l.

Obtained-from:  FreeBSD

17 years agoCheck the buffer size when copying the line returned by el_gets() into our
Peter Avalos [Sat, 13 Jan 2007 20:10:26 +0000 (20:10 +0000)]
Check the buffer size when copying the line returned by el_gets() into our
own buffer.  Interactively typing in long lines (>1023 characters)
previously overflowed the buffer.

Obtained-from:  FreeBSD

17 years agoFix typo and remove unneeded comments.
Peter Avalos [Sat, 13 Jan 2007 19:47:55 +0000 (19:47 +0000)]
Fix typo and remove unneeded comments.

Adding an entry to the history with H_ENTER moves libedit's internal
history cursor. Reset the cursor after adding the entry to the history
when doing ``fc -s'' so the output is correct.

More libedit adjustments.

Obtained-from:  FreeBSD

17 years agoSetting 0 to c_cc[] member doesn't disable the special character function,
YONETANI Tomokazu [Sat, 13 Jan 2007 17:06:19 +0000 (17:06 +0000)]
Setting 0 to c_cc[] member doesn't disable the special character function,
use _POSIX_VDISABLE.

Hint-by: Matt
17 years agoUpdate to gcc-3.4.6
Simon Schubert [Sat, 13 Jan 2007 16:32:16 +0000 (16:32 +0000)]
Update to gcc-3.4.6

17 years agoUpdate to gcc-3.4.6
Simon Schubert [Sat, 13 Jan 2007 16:32:16 +0000 (16:32 +0000)]
Update to gcc-3.4.6

17 years agoMerge from vendor branch GCC:
Simon Schubert [Sat, 13 Jan 2007 16:32:16 +0000 (16:32 +0000)]
Merge from vendor branch GCC:
Update to gcc-3.4.6

17 years agoForgotten in previous commit: add 'verbose' bit definitions for the VMX and
Thomas E. Spanjaard [Fri, 12 Jan 2007 23:12:59 +0000 (23:12 +0000)]
Forgotten in previous commit: add 'verbose' bit definitions for the VMX and
SSSE3 bits in cpu_features2.

17 years agoPrint names for two more bits in cpu_features2: Supplemental SSE3, and I
Thomas E. Spanjaard [Fri, 12 Jan 2007 22:59:16 +0000 (22:59 +0000)]
Print names for two more bits in cpu_features2: Supplemental SSE3, and I
encountered a set bit 15 in the wild. Treat it the same as bit 2.

17 years agoFix the recently committed (and described) page writability nerf. The real
Matthew Dillon [Fri, 12 Jan 2007 22:12:53 +0000 (22:12 +0000)]
Fix the recently committed (and described) page writability nerf.  The real
kernel was unconditionally mapping writable pages read-only on read faults
in order to be able to take another fault on a write attempt.  This was needed
for early virtual kernel support in order to set the Modify bit in the
virtualized page table, but was being applied to ALL mappings rather then
just those installed by the virtual kernel.

Now the real kernel only does this for virtual kernel mappings.  Additionally,
the real kernel no longer makes the page read-only when clearing the Modify
bit in the real page table (in order to rearm the write fault).  When this
case occurs VPTE_M has already been set in the virtual page table and no
re-fault is required.

The virtual kernel now only needs to invalidate the real kernel's page
mapping when clearing the virtualized Modify bit in the virtual page table
(VPTE_M), in order to rearm the real kernel's write fault so it can detect
future modifications via the virtualized Modify bit.  Also, the virtual kernel
no longer needs to install read-only pages to detect the write fault.  This
allows the real kernel to do ALL the work required to handle VPTE_M and
make the actual page writable.  This greatly reduces the number of real
page faults that occur and greatly reduces the number of page faults which
have to be passed through to the virtual kernel.

This fix reduces fork() overhead for processes running under a virtual
kernel by 70%, from around 2100uS to around 650uS.

17 years agoAdd single-user mode boot option (-s).
Matthew Dillon [Fri, 12 Jan 2007 18:31:18 +0000 (18:31 +0000)]
Add single-user mode boot option (-s).

Submitted-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
17 years agoAdd missing bzero() during low boot after malloc().
Matthew Dillon [Fri, 12 Jan 2007 18:27:09 +0000 (18:27 +0000)]
Add missing bzero() during low boot after malloc().

Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
17 years agoSet kernel_vm_end to virtual_start instead of virtual_end so it can be used
Matthew Dillon [Fri, 12 Jan 2007 18:03:48 +0000 (18:03 +0000)]
Set kernel_vm_end to virtual_start instead of virtual_end so it can be used
to detemine how much KVM has been reserved so far (so vm.kvm_free works).

As part of the same deal, redo pmap_growkernel() to just increase
kernel_vm_end up to its limit, instead of just panicing.

Remove in incorrect NULLing out of pmap->pm_pdir.  This was causing the
kernel_map to grow forever until it ran out of space and the system paniced.

17 years agoAdjust the gdb patch to account for the new register structure.
Matthew Dillon [Fri, 12 Jan 2007 07:17:56 +0000 (07:17 +0000)]
Adjust the gdb patch to account for the new register structure.

17 years agoDisable sshd on the Live CD. This just takes time generating the
Simon Schubert [Fri, 12 Jan 2007 06:56:24 +0000 (06:56 +0000)]
Disable sshd on the Live CD.  This just takes time generating the
keys, and doesn't provide any benefit.  If you want to log in from
remote, you still have to allow root logins for sshd.

17 years agoMisc cleanups.
Matthew Dillon [Fri, 12 Jan 2007 06:07:29 +0000 (06:07 +0000)]
Misc cleanups.