dragonfly.git
15 years agoFix format string
Joerg Sonnenberger [Tue, 24 Feb 2004 19:35:30 +0000 (19:35 +0000)]
Fix format string

15 years agoFix argument order for snprintf, the size is the second argument
Joerg Sonnenberger [Tue, 24 Feb 2004 19:27:25 +0000 (19:27 +0000)]
Fix argument order for snprintf, the size is the second argument

15 years agoFix format string
Joerg Sonnenberger [Tue, 24 Feb 2004 19:25:13 +0000 (19:25 +0000)]
Fix format string

15 years agoRemove unused static declarations
Joerg Sonnenberger [Tue, 24 Feb 2004 19:23:37 +0000 (19:23 +0000)]
Remove unused static declarations

15 years agoAdd prototype for bootpc_init
Joerg Sonnenberger [Tue, 24 Feb 2004 19:22:38 +0000 (19:22 +0000)]
Add prototype for bootpc_init

15 years agoRemove unused static variable
Joerg Sonnenberger [Tue, 24 Feb 2004 19:17:08 +0000 (19:17 +0000)]
Remove unused static variable

15 years agoFix a typo and include <sys/random.h>
Joerg Sonnenberger [Tue, 24 Feb 2004 19:00:36 +0000 (19:00 +0000)]
Fix a typo and include <sys/random.h>

15 years agoFix some warnings
Joerg Sonnenberger [Tue, 24 Feb 2004 18:44:20 +0000 (18:44 +0000)]
Fix some warnings

15 years agoUse ovbcopy instead of bcopy to match prototyp
Joerg Sonnenberger [Tue, 24 Feb 2004 18:41:57 +0000 (18:41 +0000)]
Use ovbcopy instead of bcopy to match prototyp

15 years agoHide ISA compatibility layer under COMPAT_OLDISA
Joerg Sonnenberger [Tue, 24 Feb 2004 18:11:16 +0000 (18:11 +0000)]
Hide ISA compatibility layer under COMPAT_OLDISA

15 years agoUse -fformat-extensions when building kernel with GCC2.
Joerg Sonnenberger [Tue, 24 Feb 2004 18:07:11 +0000 (18:07 +0000)]
Use -fformat-extensions when building kernel with GCC2.

15 years agoAdd support for the kernel printf conversion specifiers %b, %D and %ry.
Joerg Sonnenberger [Tue, 24 Feb 2004 18:04:20 +0000 (18:04 +0000)]
Add support for the kernel printf conversion specifiers %b, %D and %ry.
Adjust the warning about %c only yielding 2 digits.

Patch based on FreeBSD's modification for the in-tree c-format.c

15 years agoSplit off the PCI-PCI bridge and the PCI-ISA bridge code from
Joerg Sonnenberger [Tue, 24 Feb 2004 15:21:25 +0000 (15:21 +0000)]
Split off the PCI-PCI bridge and the PCI-ISA bridge code from
pcisupport.c. This moves just code around and is non-functional.

15 years agoDFports cleanup part(1)
Joerg Sonnenberger [Tue, 24 Feb 2004 13:05:14 +0000 (13:05 +0000)]
DFports cleanup part(1)

This removes the redefinition of PORTSDIR to /usr/dfports. We use the normal
/usr/ports and have a second variable DFPORTSDIR for DragonFly override ports.

Also fix the warning about an undefined command when invocing make for an
overriden port without specifying a target.

15 years agoAdd missing make_dev
Joerg Sonnenberger [Tue, 24 Feb 2004 11:52:31 +0000 (11:52 +0000)]
Add missing make_dev

15 years agoMake nexus understand the new INTR_ flags, mainly INTR_ENTROPY.
Matthew Dillon [Mon, 23 Feb 2004 21:23:42 +0000 (21:23 +0000)]
Make nexus understand the new INTR_ flags, mainly INTR_ENTROPY.
Fixes the: mpt, aac, amr, mlx, and twe drivers.

Reported-by: David Rhodus <drhodus@machdep.com>
15 years agoFix comment to show the munlockall function, and not the mlockall one.
Eirik Nygaard [Mon, 23 Feb 2004 11:54:03 +0000 (11:54 +0000)]
Fix comment to show the munlockall function, and not the mlockall one.

15 years agoCertain port Makefiles expect variables like ARCH or HAVE_GNOME to be set
Joerg Sonnenberger [Sun, 22 Feb 2004 14:28:50 +0000 (14:28 +0000)]
Certain port Makefiles expect variables like ARCH or HAVE_GNOME to be set
and use them in .if's. This adds a default value for those currently use
to fix parsing the main Makefile if bsd.port.pre.mk is used.

15 years agoFix compilation with -fno-common
Joerg Sonnenberger [Sun, 22 Feb 2004 12:11:00 +0000 (12:11 +0000)]
Fix compilation with -fno-common

15 years agoRemove static resource_disabled(), the function is now supplied by
Matthew Dillon [Sun, 22 Feb 2004 07:27:56 +0000 (07:27 +0000)]
Remove static resource_disabled(), the function is now supplied by
kern/subr_bus.c.

15 years agoINTR_TYPE_AV is used by FreeBSD 5 code and was defined to INTR_TYPE_TTY
Joerg Sonnenberger [Sat, 21 Feb 2004 19:12:39 +0000 (19:12 +0000)]
INTR_TYPE_AV is used by FreeBSD 5 code and was defined to INTR_TYPE_TTY
before. Keep this behaviour for the nexus interrupt handling and don't
panic.

15 years agoINTR_EXCL moved to sys/bus.h, add #include.
Matthew Dillon [Sat, 21 Feb 2004 17:35:35 +0000 (17:35 +0000)]
INTR_EXCL moved to sys/bus.h, add #include.

Reported-by: David Rhodus <drhodus@machdep.com>
15 years agoBring in additional stuff from FreeBSD-5, fixing some issues (fwohci not
Matthew Dillon [Sat, 21 Feb 2004 17:05:52 +0000 (17:05 +0000)]
Bring in additional stuff from FreeBSD-5, fixing some issues (fwohci not
being able to map memory, and other issues).

15 years agoAdd supfile to fetch only dfports
Joerg Sonnenberger [Sat, 21 Feb 2004 14:22:39 +0000 (14:22 +0000)]
Add supfile to fetch only dfports

15 years agoInclude the required machine/bus.h if we do not already have it.
Matthew Dillon [Sat, 21 Feb 2004 09:17:10 +0000 (09:17 +0000)]
Include the required machine/bus.h if we do not already have it.

15 years agoFix a bug in the last commit. 4.x improperly tries to add the children
Matthew Dillon [Sat, 21 Feb 2004 09:16:27 +0000 (09:16 +0000)]
Fix a bug in the last commit.  4.x improperly tries to add the children
of a PCI bus during the probe phase.  This doesn't mix well with 5.x's
bus code which adds the children in the attach phase.  Clean up
pci_probe().  The code, unfortunately, is still quite fragile.

Cleanup pci_read_device().

Bring in pcib_*() routines from 5.x into pcisupport.c.  Add support for
bridges which do not support particular PCI mapping types (from FreeBSD 5.x).

Fix a bug in the pcib_route_interrupt() method.

15 years agoBring in acpica-unix-20031203. As with other contrib imports, this import
Matthew Dillon [Sat, 21 Feb 2004 06:58:11 +0000 (06:58 +0000)]
Bring in acpica-unix-20031203.  As with other contrib imports, this import
represents an exact copy of the vendor distribution plus a README.DRAGONFLY
file.  The related build infrastructure is /usr/src/sys/dev/acpica5 and
/usr/src/sys/i386/acpica5.

15 years agoBring in the FreeBSD-5 ACPICA code as a module. Note: not hooked up yet,
Matthew Dillon [Sat, 21 Feb 2004 06:48:09 +0000 (06:48 +0000)]
Bring in the FreeBSD-5 ACPICA code as a module.  Note: not hooked up yet,
still under development.  Also note that the original ACPICA code is being
left intact.

15 years agoSynchronize a bunch of things from FreeBSD-5 in preparation for the new
Matthew Dillon [Sat, 21 Feb 2004 06:41:41 +0000 (06:41 +0000)]
Synchronize a bunch of things from FreeBSD-5 in preparation for the new
ACPICA driver support.

* Bring in a lot of new bus and pci DEV_METHODs from FreeBSD-5
* split apic.h into apicreg.h and apicio.h
* rename INTR_TYPE_FAST -> INTR_FAST and move the #define
* rename INTR_TYPE_EXCL -> INTR_EXCL and move the #define
* rename some PCIR_ registers and add additional macros from FreeBSD-5
* note: new pcib bus call, host_pcib_get_busno() imported.
* kern/subr_power.c no longer optional.

Other changes:

* machine/smp.h machine smp/smptests.h can now be #included unconditionally,
  and some APIC_IO vs SMP separation has been done as well.
* gd_acpi_id and gd_apic_id added to machine/globaldata.h prep for new
  ACPI code.

Despite all the changes, the generated code should be virtually the same.
These were mostly additions which the pre-existing code does not (yet) use.

15 years agoSynchronize a bunch of things from FreeBSD-5 in preparation for the new
Matthew Dillon [Sat, 21 Feb 2004 06:37:08 +0000 (06:37 +0000)]
Synchronize a bunch of things from FreeBSD-5 in preparation for the new
ACPICA driver support.

* Bring in a lot of new bus and pci DEV_METHODs from FreeBSD-5
* split apic.h into apicreg.h and apicio.h
* rename INTR_TYPE_FAST -> INTR_FAST and move the #define
* rename INTR_TYPE_EXCL -> INTR_EXCL and move the #define
* rename some PCIR_ registers and add additional macros from FreeBSD-5
* note: new pcib bus call, host_pcib_get_busno() imported.
* kern/subr_power.c no longer optional.

Other changes:

* machine/smp.h machine smp/smptests.h can now be #included unconditionally,
  and some APIC_IO vs SMP separation has been done as well.
* gd_acpi_id and gd_apic_id added to machine/globaldata.h prep for new
  ACPI code.

Despite all the changes, the generated code should be virtually the same.
These were mostly additions which the pre-existing code does not (yet) use.

15 years ago* Fix placement of return value.
David Rhodus [Fri, 20 Feb 2004 22:40:58 +0000 (22:40 +0000)]
* Fix placement of return value.

15 years ago* Return if array is out of bounds in icu_setup function.
David Rhodus [Fri, 20 Feb 2004 22:01:20 +0000 (22:01 +0000)]
* Return if array is out of bounds in icu_setup function.

Ref: FreeBSD PR 30857

15 years agoImplement a pipe KVM cache primarily to reduce unnecessary TLB IPIs between
Matthew Dillon [Fri, 20 Feb 2004 17:11:08 +0000 (17:11 +0000)]
Implement a pipe KVM cache primarily to reduce unnecessary TLB IPIs between
cpcus on MP systems due to continuous KVM allocations.

15 years agoM_NOWAIT work stage 1/999: Fix some boot-time misuses of M_NOWAIT -> M_WAITOK
Matthew Dillon [Fri, 20 Feb 2004 17:10:14 +0000 (17:10 +0000)]
M_NOWAIT work stage 1/999:  Fix some boot-time misuses of M_NOWAIT -> M_WAITOK
inherited from FBsd 4.x and 5.x.

15 years agoRCNG, shutdown ppp connections nicely when told to.
Matthew Dillon [Thu, 19 Feb 2004 21:32:15 +0000 (21:32 +0000)]
RCNG, shutdown ppp connections nicely when told to.

Submitted-by: Peter Kadau <peter.kadau@tuebingen.mpg.de> (on 15 Dec 2003)
15 years agoAdd generated pcidevs files. Fix a small typo in devlist2h.awk.
Joerg Sonnenberger [Thu, 19 Feb 2004 20:47:57 +0000 (20:47 +0000)]
Add generated pcidevs files. Fix a small typo in devlist2h.awk.

15 years agoPCCARD has a central device database in bus/pccard/pccarddevs, add one
Joerg Sonnenberger [Thu, 19 Feb 2004 20:46:15 +0000 (20:46 +0000)]
PCCARD has a central device database in bus/pccard/pccarddevs, add one
for PCI as well. This allows us to centralize the definitions of PCI IDs
and removes the need for numerical magic constants all over the place.
Another advantage is that it allows us to display proper strings even
for devices w/o driver.

Imported from NetBSD current.

15 years agoRemove some unneeded #include
Joerg Sonnenberger [Thu, 19 Feb 2004 19:44:06 +0000 (19:44 +0000)]
Remove some unneeded #include

15 years agoAdd PCCARD match function to ata. Code taken from FreeBSD.
Joerg Sonnenberger [Thu, 19 Feb 2004 15:51:46 +0000 (15:51 +0000)]
Add PCCARD match function to ata. Code taken from FreeBSD.

15 years agoAdd PCCARD match routines sio and the disk drivers.
Joerg Sonnenberger [Thu, 19 Feb 2004 15:48:26 +0000 (15:48 +0000)]
Add PCCARD match routines sio and the disk drivers.

Partly taken from FreeBSD.

15 years agoRemove duplicate line for if_ray
Joerg Sonnenberger [Thu, 19 Feb 2004 15:05:26 +0000 (15:05 +0000)]
Remove duplicate line for if_ray

15 years agoAdd proper match routines for PCCARD nics.
Joerg Sonnenberger [Thu, 19 Feb 2004 14:31:13 +0000 (14:31 +0000)]
Add proper match routines for PCCARD nics.

IDs and match routines taken from FreeBSD.

15 years agoFix typo.
Joerg Sonnenberger [Wed, 18 Feb 2004 16:31:37 +0000 (16:31 +0000)]
Fix typo.

Reported by YONETANI Tomokazu. <qhwt+dragonfly-submit@les.ath.cx>

15 years agopmap_zero_page expects an address, not a page number
Joerg Sonnenberger [Wed, 18 Feb 2004 16:28:21 +0000 (16:28 +0000)]
pmap_zero_page expects an address, not a page number

15 years ago* Remove ufs_disksubr.c from kernel build files.
David Rhodus [Wed, 18 Feb 2004 15:41:56 +0000 (15:41 +0000)]
* Remove ufs_disksubr.c from kernel build files.

15 years agoMerge vfs/ufs/ufs_disksubr.c into kern/subr_disk.c. The procedures in
Matthew Dillon [Wed, 18 Feb 2004 06:59:16 +0000 (06:59 +0000)]
Merge vfs/ufs/ufs_disksubr.c into kern/subr_disk.c.  The procedures in
ufs_disksubr.c are used globally and not ufs-specific.

15 years agoATAng stage 6: Comment-only. Many thanks to David Rhodus for generating
Matthew Dillon [Wed, 18 Feb 2004 04:32:40 +0000 (04:32 +0000)]
ATAng stage 6: Comment-only.  Many thanks to David Rhodus for generating
a base patch set from FreeBSD-4 for all the ATANG integration work.

15 years agoAdd experimental (as in hacked) support for the Silicon Image SATA
Matthew Dillon [Wed, 18 Feb 2004 04:12:00 +0000 (04:12 +0000)]
Add experimental (as in hacked) support for the Silicon Image SATA
controller 3512.  run it like the SiI 0680 ATA133 controller for now.

It works operating as a non-raid ata device on an FN85 Shuttle (AMD64)
motherboard.  The controller is theoretically a raid controller there is
no current support for it.

15 years agoATAng stage 5: sync chipset changes and bug fixes. busdma is not synched yet.
Matthew Dillon [Wed, 18 Feb 2004 04:08:49 +0000 (04:08 +0000)]
ATAng stage 5: sync chipset changes and bug fixes.  busdma is not synched yet.

15 years agoATAng stage 5: sync additional function API changes from FBsd-4. We now
Matthew Dillon [Wed, 18 Feb 2004 02:47:38 +0000 (02:47 +0000)]
ATAng stage 5: sync additional function API changes from FBsd-4.  We now
have everything except the dma chipset changes and the busdma changes.
Note that we retain our MPIPE code as it is far superior to what is in 4.x and
5.x.

15 years agoATAng stage 4: sync additional atang from 4.x, all non-operational changes
Matthew Dillon [Wed, 18 Feb 2004 02:01:37 +0000 (02:01 +0000)]
ATAng stage 4: sync additional atang from 4.x, all non-operational changes
except for one offset calculation.  pushdown API.

15 years agoATAng stage 3: sync additional atang from 4.x, mostly non-opertional changes,
Matthew Dillon [Wed, 18 Feb 2004 01:35:59 +0000 (01:35 +0000)]
ATAng stage 3: sync additional atang from 4.x, mostly non-opertional changes,
changes in procedure args, etc.

15 years agoATAng stage 2: sync part of the ata_dma*() API. No operational changes.
Matthew Dillon [Wed, 18 Feb 2004 00:50:00 +0000 (00:50 +0000)]
ATAng stage 2: sync part of the ata_dma*() API.  No operational changes.

15 years agoATAng stage 1: synch ad_attach() and atapi_attach(), including a fix for
Matthew Dillon [Wed, 18 Feb 2004 00:37:08 +0000 (00:37 +0000)]
ATAng stage 1: synch ad_attach() and atapi_attach(), including a fix for
a recursive lock issue.

15 years ago(followup) remove lockid.
Matthew Dillon [Tue, 17 Feb 2004 19:39:38 +0000 (19:39 +0000)]
(followup) remove lockid.

15 years agoIntroduce an MI cpu synchronization API, redo the SMP AP startup code,
Matthew Dillon [Tue, 17 Feb 2004 19:38:54 +0000 (19:38 +0000)]
Introduce an MI cpu synchronization API, redo the SMP AP startup code,
and start cleaning up deprecated IPI and clock code.  Add a MMU/TLB page
table invalidation API (pmap_inval.c) which properly synchronizes page
table changes with other cpus in SMP environments.

    * removed (unused) gd_cpu_lockid
    * remove confusing invltlb() and friends, normalize use of cpu_invltlb()
      and smp_invltlb().
    * redo the SMP AP startup code to make the system work better in
      situations where all APs do not startup.
    * add memory barrier API, cpu_mb1() and cpu_mb2().
    * remove (obsolete, no longer used) old IPI hard and stat clock forwarding
      code.
    * add a cpu synchronization API which is capable of handling multiple
      simultanious requests without deadlocking or livelocking.
    * major changes to the PMAP code to use the new invalidation API.
    * remove (unused) all_procs_ipi() and self_ipi().
    * only use all_but_self_ipi() if it is known that all AP's started up,
      otherwise use a mask.
    * remove (obsolete, no longer usde) BETTER_CLOCK code
    * remove (obsolete, no longer used) Xcpucheckstate IPI code

Testing-by: David Rhodus and others
15 years agoInstall getopt_long.3
Joerg Sonnenberger [Tue, 17 Feb 2004 17:04:57 +0000 (17:04 +0000)]
Install getopt_long.3

15 years agoUndo part of the last commit. Part of a different patch set leaked into it
Matthew Dillon [Mon, 16 Feb 2004 21:08:24 +0000 (21:08 +0000)]
Undo part of the last commit.  Part of a different patch set leaked into it
which is not ready to be committedy et.

15 years agoRemove duplicate declarations for -fno-common
Matthew Dillon [Mon, 16 Feb 2004 20:48:35 +0000 (20:48 +0000)]
Remove duplicate declarations for -fno-common

15 years agoRemove duplicate declarations for -fno-common
Matthew Dillon [Mon, 16 Feb 2004 20:37:20 +0000 (20:37 +0000)]
Remove duplicate declarations for -fno-common

15 years agoRemove common declaration for -fno-common
Matthew Dillon [Mon, 16 Feb 2004 20:13:26 +0000 (20:13 +0000)]
Remove common declaration for -fno-common

15 years agoCompile the kernel with -fno-common to guarentee that we do not accidently
Matthew Dillon [Mon, 16 Feb 2004 19:57:39 +0000 (19:57 +0000)]
Compile the kernel with -fno-common to guarentee that we do not accidently
put non-extern'd variable declarations in header files.  Our module loader
no longer deals with commons so duplicate declarations can cause kldloaded
modules to fail, and its sloppy programming anyway.

15 years agoRemove common variable to get ready for -fno-common.
Matthew Dillon [Mon, 16 Feb 2004 19:56:26 +0000 (19:56 +0000)]
Remove common variable to get ready for -fno-common.

15 years agoAdd a dependant include.
Matthew Dillon [Mon, 16 Feb 2004 19:49:28 +0000 (19:49 +0000)]
Add a dependant include.

15 years agoRemove duplicate bioops declaration in preparation for -fno-common
Matthew Dillon [Mon, 16 Feb 2004 19:48:51 +0000 (19:48 +0000)]
Remove duplicate bioops declaration in preparation for -fno-common

15 years agoRemove duplicate declarations in preparation for adding -fno-common to
Matthew Dillon [Mon, 16 Feb 2004 19:43:28 +0000 (19:43 +0000)]
Remove duplicate declarations in preparation for adding -fno-common to
the kernel compile.

15 years agobuftimetoken must be declared in a .c file.
Matthew Dillon [Mon, 16 Feb 2004 19:37:48 +0000 (19:37 +0000)]
buftimetoken must be declared in a .c file.

15 years agoAdd BUS_DMA_ZERO flag to bus_dmamem_alloc.
Joerg Sonnenberger [Mon, 16 Feb 2004 19:35:53 +0000 (19:35 +0000)]
Add BUS_DMA_ZERO flag to bus_dmamem_alloc.

Add support for M_ZERO to contigmalloc inspired by rev. 1.21 and 1.23 of by
mux to FreeBSD's vm_contig.c

15 years agoMake buftimetoken an extern so it is not declared as a common variable.
Matthew Dillon [Mon, 16 Feb 2004 19:09:31 +0000 (19:09 +0000)]
Make buftimetoken an extern so it is not declared as a common variable.
Modules were compiling up with their own local copy of buftimetoken rather
then linking against the kernel's buftimetoken, causing modules to crash.

Reported-by: Adam K Kirchhoff <adamk@voicenet.com>
15 years agoAdd pci_get_ether and pci_set_ether for FreeBSD 5 compatibility
Joerg Sonnenberger [Mon, 16 Feb 2004 18:51:01 +0000 (18:51 +0000)]
Add pci_get_ether and pci_set_ether for FreeBSD 5 compatibility

15 years agoAdd PCIR_BAR and PCIR_BARS for FreeBSD 5 compatibility
Joerg Sonnenberger [Mon, 16 Feb 2004 18:49:55 +0000 (18:49 +0000)]
Add PCIR_BAR and PCIR_BARS for FreeBSD 5 compatibility

15 years agoAdd device_is_attached to allow a driver to check wether a given device
Joerg Sonnenberger [Mon, 16 Feb 2004 18:48:03 +0000 (18:48 +0000)]
Add device_is_attached to allow a driver to check wether a given device
was or was not succesfully attached to the device tree.

15 years agoInstall new .mk files (/usr/src/share/mk) as part of the upgrade_etc target.
Matthew Dillon [Mon, 16 Feb 2004 05:14:03 +0000 (05:14 +0000)]
Install new .mk files (/usr/src/share/mk) as part of the upgrade_etc target.

15 years agoCleanup and augment the cpu synchronization API a bit. Embed the maxcount
Matthew Dillon [Sun, 15 Feb 2004 05:15:27 +0000 (05:15 +0000)]
Cleanup and augment the cpu synchronization API a bit.  Embed the maxcount
in the structure rather then returning it and requiring it to be passed
again, and document the procedures a bit more.

15 years agoSplit the IPIQ messaging out of lwkt_thread.c and move it to its own file,
Matthew Dillon [Sun, 15 Feb 2004 02:14:42 +0000 (02:14 +0000)]
Split the IPIQ messaging out of lwkt_thread.c and move it to its own file,
lwkt_ipiq.c.

Add a MI synchronous cpu rendezvous API lwkt_cpusync_*().  This API allows the
kernel to synchronize an operation across any number of cpus.  Multiple cpus
can initiate synchronization operations simultaniously without creating a
deadlock.  The API utilizes the IPI messaging core and guarentees that
other synchronization and IPI messaging operations will continue to work
during any given synchronization op.  The API is a spin-blocking API, meaning
that it will not switch threads and can be used by mainline code, interrupts,
and other sensitive code.

This API is intended to replace smp_rendezvous(), Xcpustop, and other
hardwired IPI ops.  It will also be used to fix our TLB shootdown code.

As of this commit the API has not yet been connected to anything and has
been tested only a little.

15 years agoatomic_*_*_nonlocked() inlines are not MP locked. Remove the MPLOCKED
Matthew Dillon [Sat, 14 Feb 2004 22:26:43 +0000 (22:26 +0000)]
atomic_*_*_nonlocked() inlines are not MP locked.  Remove the MPLOCKED
prefix for these ops.

15 years agoRemove old in_cksum.c and in_cksum.h (they were moved to netinet and sys
Matthew Dillon [Sat, 14 Feb 2004 21:13:54 +0000 (21:13 +0000)]
Remove old in_cksum.c and in_cksum.h (they were moved to netinet and sys
respectively).

15 years agoMove <machine/in_cksum.h> to <sys/in_cksum.h>. This file is now platform
Matthew Dillon [Sat, 14 Feb 2004 21:15:34 +0000 (21:15 +0000)]
Move <machine/in_cksum.h> to <sys/in_cksum.h>.  This file is now platform
independant.  If we want to add extreme machine specialization later on
then sys/in_cksum.h will #include machine/in_cksum.h.

Move i386/i386/in_cksum.c to netinet/in_cksum.c.  Note that netinet/in_cksum.c
already existed but was not used by the build system at all.  The move
overwrites it.  The new in_cksum.c is a portable, complete rewrite which
references core assembly (procedure call) to do 32-bit-aligned work.  See
also i386/i386/in_cksum2.s.

15 years agoCreate a new machine type, cpumask_t, to represent a mask of cpus, and
Matthew Dillon [Sat, 14 Feb 2004 20:34:33 +0000 (20:34 +0000)]
Create a new machine type, cpumask_t, to represent a mask of cpus, and
replaces earlier uses of __uint32_t for cpu masks with cpumask_t.

15 years agoGet rid of some old cruft and add a failsafe for M_WAITOK which guarentees
Matthew Dillon [Sat, 14 Feb 2004 20:02:28 +0000 (20:02 +0000)]
Get rid of some old cruft and add a failsafe for M_WAITOK which guarentees
that malloc() will not attempt to reuse pages from the VM page cache if
called with M_WAITOK from a preemption.

If M_WAITOK is used in a malloc called from a preemption, and we would block,
do an initial yield instead of blocking.  This does not effect sequencing
of the preemption since either will cause the preemption to return and the
blocking thread to be scheduled normally, but yield as a first go will get
the cpu back more quickly.

15 years agoChange M_NOWAIT to M_WAITOK. This does not fix any known issues but it
Matthew Dillon [Sat, 14 Feb 2004 19:58:50 +0000 (19:58 +0000)]
Change M_NOWAIT to M_WAITOK.  This does not fix any known issues but it
makes the code properly conform to the malloc API.  Using M_NOWAIT
during booting to mean 'if we block here we would deadlock during boot' but
then assuming that the return value is always non-NULL is worse then
using M_WAITOK and potentially allowing the system to deadlock but, not
really, because there is plenty of memory available during booting.

15 years agoActively manage cam rescan timeouts in the usb subsystem. This does not
Matthew Dillon [Sat, 14 Feb 2004 19:56:28 +0000 (19:56 +0000)]
Actively manage cam rescan timeouts in the usb subsystem.  This does not
fix any known issues but it should make things a bit more robust.

15 years agoAdd PCI busses to the device list in bus number order to make debug output
Matthew Dillon [Sat, 14 Feb 2004 19:54:40 +0000 (19:54 +0000)]
Add PCI busses to the device list in bus number order to make debug output
more understandable.

15 years agogcc2 doesn't like ary[] inside structures. Add __ARRAY_ZERO to
Matthew Dillon [Sat, 14 Feb 2004 17:55:50 +0000 (17:55 +0000)]
gcc2 doesn't like ary[] inside structures.  Add __ARRAY_ZERO to
sys/cdefs.h to take care of the differences between GCC2 and GCC3.

15 years agoC99 specify ary[] instead of ary[0] in structure.
Matthew Dillon [Sat, 14 Feb 2004 17:47:41 +0000 (17:47 +0000)]
C99 specify ary[] instead of ary[0] in structure.

Obtained-from: FreeBSD-5
Submitted-by: YONETANI Tomokazu <qhwt+dragonfly-submit@les.ath.cx>
15 years agoReplace K&R style functions with ANSI C style functions.
Eirik Nygaard [Sat, 14 Feb 2004 12:14:30 +0000 (12:14 +0000)]
Replace K&R style functions with ANSI C style functions.

15 years agoRemove my middle initial.
Hiten Pandya [Sat, 14 Feb 2004 03:54:36 +0000 (03:54 +0000)]
Remove my middle initial.

15 years agoFix forgotten lwkt_send_ipiq() API update. cpuid -> globaldata pointer
Matthew Dillon [Sat, 14 Feb 2004 02:18:25 +0000 (02:18 +0000)]
Fix forgotten lwkt_send_ipiq() API update.  cpuid -> globaldata pointer

Reported-by: Adam K Kirchhoff <adamk@voicenet.com>
15 years agoRewrite the IP checksum code. Get rid of all the inline assembly garbage,
Matthew Dillon [Sat, 14 Feb 2004 02:09:28 +0000 (02:09 +0000)]
Rewrite the IP checksum code.  Get rid of all the inline assembly garbage,
get rid of old APIs that are no longer used, and build a new 'core' checksum
function in C capable of handling any alignment.  Add an assembly procedure
(in its own file) for handling large blocks of 32-bit aligned data.

This new code is better suited for modern cpus and should at least as good
as the previous code, and it is far more portable.

Note that in_cksum_hdr() still assumes 32 bit alignment.  This will be fixed
soon.

15 years agoFix warnings about casting const pointers.
Joerg Sonnenberger [Fri, 13 Feb 2004 22:12:34 +0000 (22:12 +0000)]
Fix warnings about casting const pointers.
Adjust the pccard_get_IVAR to return the wanted value, instead of
writing it to a result pointer. This fellows to practice of the other
bus interfaces.
Adjust pccard_get_ethaddr to return a pointer to the actual hardware
address instead of interpreting result as pointer to a memory region.

15 years agoSync if_ed with FreeBSD current
Joerg Sonnenberger [Fri, 13 Feb 2004 21:15:12 +0000 (21:15 +0000)]
Sync if_ed with FreeBSD current

15 years agoOops. Forgot to renumber the %N's in the macros in the last commit.
Matthew Dillon [Fri, 13 Feb 2004 19:37:16 +0000 (19:37 +0000)]
Oops.  Forgot to renumber the %N's in the macros in the last commit.

15 years agoAdd __DragonFly__
Joerg Sonnenberger [Fri, 13 Feb 2004 19:06:15 +0000 (19:06 +0000)]
Add __DragonFly__

15 years agobio ops can be initiated from the buffer cache, td_proc may be NULL here.
Matthew Dillon [Fri, 13 Feb 2004 18:52:35 +0000 (18:52 +0000)]
bio ops can be initiated from the buffer cache, td_proc may be NULL here.
This is a degenerate case from earlier conversion work.  cred is not used
here so td_proc can be NULL.

Reported-by: David Rhodus <drhodus@machdep.com>
15 years agoUse "iq" instead of "ir" for the register constraint. "iq" means 'an
Matthew Dillon [Fri, 13 Feb 2004 18:44:42 +0000 (18:44 +0000)]
Use "iq" instead of "ir" for the register constraint.  "iq" means 'an
integer constant or one of %ax,%bx,%cx, or %dx.  The prior use of "ir"
could cause GCC to attempt to use a 'low byte' accessor on a register
that cannot be accessed that way, such as '%si' (e.g. %sil).  I see no
need to get fancy so I am just applying %iq to all the atomic instructions.
It's good enough.

Reported-by: YONETANI Tomokazu <qhwt+dragonfly-bugs@les.ath.cx>
15 years agoAdd __DragonFly__
Joerg Sonnenberger [Fri, 13 Feb 2004 17:45:51 +0000 (17:45 +0000)]
Add __DragonFly__

15 years agoFix # style comment in file using the C prepocessor
Joerg Sonnenberger [Fri, 13 Feb 2004 16:13:44 +0000 (16:13 +0000)]
Fix # style comment in file using the C prepocessor

15 years agoFix broken string literals
Joerg Sonnenberger [Fri, 13 Feb 2004 13:43:21 +0000 (13:43 +0000)]
Fix broken string literals

15 years agoAdd -D__FreeBSD__ for buildworld (vacation pulls source files from
Matthew Dillon [Fri, 13 Feb 2004 03:53:37 +0000 (03:53 +0000)]
Add -D__FreeBSD__ for buildworld (vacation pulls source files from
contrib/sendmail)

15 years agoConvert __FreeBSD__ tests to __FreeBSD__ and __DragonFly__ tests
Matthew Dillon [Fri, 13 Feb 2004 03:49:50 +0000 (03:49 +0000)]
Convert __FreeBSD__ tests to __FreeBSD__ and  __DragonFly__ tests