]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
19 years agoMFi386: set PMC vector
peter [Sun, 22 May 2005 16:32:02 +0000 (16:32 +0000)]
MFi386: set PMC vector

19 years agoMFi386: remove comment
peter [Sun, 22 May 2005 16:31:32 +0000 (16:31 +0000)]
MFi386: remove comment

19 years agoStyle: mostly tabs vs blanks, and semicolon placement.
schweikh [Sun, 22 May 2005 16:22:23 +0000 (16:22 +0000)]
Style: mostly tabs vs blanks, and semicolon placement.

19 years agosoundcard -> sound card
brueffer [Sun, 22 May 2005 16:14:55 +0000 (16:14 +0000)]
soundcard -> sound card

MFC after: 3 days

19 years ago- Add a HARDWARE section based on the previous 'Supported Cards'
brueffer [Sun, 22 May 2005 15:25:14 +0000 (15:25 +0000)]
- Add a HARDWARE section based on the previous 'Supported Cards'
  subsection and the hardware notes.
- Xref all snd_* drivers

MFC after: 1 week

19 years agoBCM5789 support.
brueffer [Sun, 22 May 2005 10:27:51 +0000 (10:27 +0000)]
BCM5789 support.

MFC after: 3 days

19 years agoAdd PCI ID for BCM5789.
silby [Sun, 22 May 2005 03:16:45 +0000 (03:16 +0000)]
Add PCI ID for BCM5789.

Submitted by: S. Aeschbacher

19 years agoRemove GIANT_REQUIRED from swapout_procs().
alc [Sun, 22 May 2005 00:30:50 +0000 (00:30 +0000)]
Remove GIANT_REQUIRED from swapout_procs().

19 years ago- Hook up machfb(4) to the sparc64 build, not enabled in GENERIC
marius [Sat, 21 May 2005 20:50:45 +0000 (20:50 +0000)]
- Hook up machfb(4) to the sparc64 build, not enabled in GENERIC
  by default, yet.
- Replace "graphics cards" with "framebuffers" in the description
  of creator(4) in order to make it uniform with the description of
  machfb(4) and the latter occur both on-board and as add-on cards.

19 years agoAdd machfb(4), a driver for ATI Mach64 graphics chips intended for
marius [Sat, 21 May 2005 20:47:38 +0000 (20:47 +0000)]
Add machfb(4), a driver for ATI Mach64 graphics chips intended for
use with syscons(4) on sparc64. It's based on the respective NetBSD
driver with some additional info (initialisation/hardware cursor)
obtained from the Xorg 'ati' driver and some ideas taken from
creator(4). ATI Mach64 chips ("ATI Rage") are quite common as low-
end graphics chips in PCI-based sun4u machines and are used on-board
in e.g. Blade 100 and a couple of OEM products. Most if not all of
the Sun PGX add-on cards family (descriptions of the PGX32 are
conflicting but most say it's a Rage Pro) are also based on these
chips. Depending on the version of the OBP Mach64 cards destined for
use in i386 machines also work in sun4u machines.
The driver uses pixel mode with hardware acceleration as far as
syscons(4) currently permits on sparc64 so text mode is already
quite fast. The hardware cursor is used for the mouse pointer;
for one because this is a "restriction" induced in syscons(4) on
sparc64 by creator(4) and also because of issues with mapping
the aperture when used as a low-level early during boot. Due to
insufficiencies in the available documentation I didn't manage to
get mode switch work properly (sync problems), yet. So for now
this driver relies on the OBP having initialised a mode (as does
creator(4)). On all of the tested machines is even true when using
a serial console (and also not only when the OBP switched to a
serial console because no keyboard is present). In general however
the states the Mach64 chips are left in by the OBP vary a lot
depending on the version of the OBP. This e.g. includes the aperture
not being mapped in even when used as the console and the OBP just
barfing when asked to map it. The latter is also the reason for the
existence of this native driver in FreeBSD rather than taking an
OFW frambuffer approach.
Xorg is also happy to talk to these chips by mmap'ing them through
this driver. For some hardware configs like on the Blade 100 a fix
for the Xorg sparc64 MD bus code is however needed (added in version
6.8.2_2 of the xorg-server port).
The video driver font loading and saving methods are not implemented,
yet, as syscons(4) needs more work in that area to work viable on
sparc64.
With minor modifications machfb(4) would most likely also work on
powerpc, when #ifdef'ing the OFW and possibly implementing mode
setting probably also on the other archs. The latter is however
not very practible at the moment as it would conflict with vga(4).

Tested/developed with: Rage II+ add-on card on AX1105 and AXi board,
AXe board (on-board Rage Pro)
Additional testing by: marcel (Ultra 5 w/ on-board Rage Pro),
scottl (Naturetech GENIALstation 777S w/ on-board
Rage Mobility M1),
Michiel Boland and Ilmar S. Habibulin (Blade 100
w/ on-board Rage XL)

19 years agoGrab FBTYPE_NOTSUN3 and use it for FBTYPE_PCIMISC. The value matches
marius [Sat, 21 May 2005 20:40:51 +0000 (20:40 +0000)]
Grab FBTYPE_NOTSUN3 and use it for FBTYPE_PCIMISC. The value matches
the one used in NetBSD for FBTYPE_PCIMISC.

19 years agoo creator(4):
marius [Sat, 21 May 2005 20:38:26 +0000 (20:38 +0000)]
o creator(4):
  - Use register macros instead of magic values in the code. [1]
  - Check the return values of OF_getprop() and other stuff that actually
    can fail.
  - Let the unimplemented video driver methods return ENODEV rather
    than 0 so other code isn't tricked into thinking a certain operation
    was successfull. In case of e.g. the video driver creator_ioctl()
    this caused vidcontrol(1) to return random garbage information.
    Remove the TODO macros in the unimplemented video driver methods
    which did a printf("%s: unimplemented\n", __func__). Under certain
    circumstances these managed to invoke a printf() when a low-level
    console device wasn't attached, yet, causing a Fast Data Access MMU
    Miss. These macros were only really usefull for development anyway.
  - Set the struct video_adapter and struct video_info va_flags and
    vi_flags etc. as appropriate.
  - In creator_configure() don't rely on hitting the node which is the
    chosen console device first when searching the OFW tree for adapters
    compatible with this driver. Instead just check whether the chosen
    console device is a viable target for this driver. Targets that are
    not the console (including additional cards in multi-head configs)
    will be attached through creator_upa_attach(). I think this how the
    code in creator_configure() was actually meant to work.
    Honour the VIO_PROBE_ONLY flag and don't initialise and register the
    console device twice when creator_configure() is called a second time
    during sc_probe_unit().
    Let creator_configure() return the number of the found adapters,
    i.e. 1 in case probing succeeds, as it's expected. The return values
    of video adapter configure functions however currently aren't checked
    so this doesn't make a difference at the moment.
  - In creator_upa_attach() don't rely on probing and attaching the
    adapter which is the console first, in case there are multiple
    adpaters and one of them is the console this could lead into using
    the video adapter unit 0 twice.
  - Make the check for DACs with inverted cursor control a bit more
    precise and actually honour that information when turning the cursor
    on or off. Add a helper function creator_cursor_enable() for this
    in order to keep code duplication low. [1]
  - Don't bother with faking a hardware cursor in case a device is the
    console. Apparently this was meant to start kernel output right after
    where the firmware left. In general this isn't worth the fuzz and
    also had no real effect as creator_set_mode() did clear the screen
    in any case, not just in case a device was not the console.
  - Implement creator_fill_rect() and use it to actually blank the
    display in creator_blank_display() when the mode is V_DISPLAY_BLANK,
    moving blanking the display out of creator_set_mode(). Use it also
    to implement creator_set_border() so the border can be re-drawn
    when switching to a VTY from X, exiting X, etc. (which leaves us
    with a black border most of the time).
  - Implement the video driver creator_ioctl(), moving the implementation
    of the IOCTL interface from the fbN CDEV version of creator_ioctl()
    into the video driver version and use the latter to implement the
    former. Use fb_commonioctl() to handle most of the FBIO IOCTLs.
    This gives programs like vidcontrol(1) which use the video driver
    creator_ioctl() a chance of working.
    Implement turning off the cursor via the FBIOSCURSOR IOCTL, which
    Xorg uses to in order to inform the OS that it's taking over the
    cursor. In creator_putm() check whether the cursor is enabled and
    (re-)install it if necessary, moving installing the cursor out of
    creator_init() and into a helper function creator_cursor_install().
    This fixes the missing mouse pointer when switching to a VTY from X,
    exiting X, etc.
  - Some clean-up (remove unused/useless code, etc.).

o sparc64/creator/creator_upa.c / sparc64/sparc64/sc_machdep.c:
  - Attach syscons(4) as an own pseudo-device on the nexus rather than
    directly in creator_upa_attach(), similiar to attaching syscons(4)
    as a pseudo-device on isa(4) on other archs. This makes it a whole
    lot easier to do the right thing in multi-head configs, especially
    with different types of graphics adapters. [2]
  - Set SC_AUTODETECT_KBD by default so USB keyboards work out of the
    box. [2]

Based on/obtained from: Xorg 'ffb' driver [1]
Based on/obtained from: FreeBSD/powerpc [2]

19 years ago- Remove duplicate FBSDID.
marius [Sat, 21 May 2005 20:34:22 +0000 (20:34 +0000)]
- Remove duplicate FBSDID.
- Start copyright comments with /*- where missing.

19 years ago- Not every architecture defaults to a black background (e.g. sparc64
marius [Sat, 21 May 2005 20:32:27 +0000 (20:32 +0000)]
- Not every architecture defaults to a black background (e.g. sparc64
  uses white) so base the color of the border on SC_NORM_ATTR rather
  than hardcoding BG_BLACK.
- Use SC_DRIVER_NAME rather than hardcoding 'sc' in message strings
  (see also sys/dev/syscons/syscons.h rev. 1.82).

19 years agoOn sparc64 use 'syscons' rather than 'sc' for SC_DRIVER_NAME so
marius [Sat, 21 May 2005 20:29:58 +0000 (20:29 +0000)]
On sparc64 use 'syscons' rather than 'sc' for SC_DRIVER_NAME so
syscons(4) and its pseudo-devices don't get confused (including by
other device drivers) with the system controller devices which are
also termed 'sc' in the OFW tree (and which we probably want to
interface with hwpmc(4) one day).

19 years agoRemove superfluous braces and add #ifndef __sparc64__ around the
marius [Sat, 21 May 2005 20:28:15 +0000 (20:28 +0000)]
Remove superfluous braces and add #ifndef __sparc64__ around the
VTB_FRAMEBUFFER specific code. On sparc64 we don't use a buffer of
type VTB_FRAMEBUFFER (see syscons.c) and excluding the respective
code here allows to compile syscons(4) without isa(4).

Requested by: joerg, marcel, yongari

19 years ago- Sprinkle some KBD_IS_* and KBD_*_DONE macros in sunkbd_configure() as
marius [Sat, 21 May 2005 20:26:30 +0000 (20:26 +0000)]
- Sprinkle some KBD_IS_* and KBD_*_DONE macros in sunkbd_configure() as
  a band-aid allowing to call this function savely multiple times, e.g.
  during sckbdprobe() and sc_probe_unit(). Otherwise calling it a second
  time results in a non-working keyboard. This needs a lot of more work
  to actually do the right thing and work like expected.
- Let sunkbd_configure() return the number of the found keyboards, i.e.
  1 in case probing succeeds, as it's expected. The return values of the
  keyboard configure functions however currently aren't checked so this
  doesn't make a difference at the moment.
- Use FBSDID.

19 years ago- MFpowerpc: sys/powerpc/powerpc/nexus.c rev. 1.7 (partial)
marius [Sat, 21 May 2005 20:19:27 +0000 (20:19 +0000)]
- MFpowerpc: sys/powerpc/powerpc/nexus.c rev. 1.7 (partial)
  Use bus_generic_probe() and add a bus_add_child() interface method to
  allow device drivers to use the identify method to add themselves if
  need be (e.g. syscons(4)).
- Use FBSDID.

19 years ago- Make sure that the OFW address properties that are going to be decode
marius [Sat, 21 May 2005 20:17:01 +0000 (20:17 +0000)]
- Make sure that the OFW address properties that are going to be decode
  consist of the expected number of address and size cells (we can't use
  dynamic arrays here because at the point in the boot process when this
  code is used malloc() doesn't work, yet). This fixes a Fast Data Access
  MMU Miss when uart(4) (erroneously) calls OF_decode_addr() to decode
  the address of PS/2 keyboards. PS/2 keyboards use a different and also
  undocumented scheme at the first parent node than mapping at 'ranges'
  properties. It's however not worth implementing that other scheme and
  actually also fits atkbdc(4) better to just start at the first parent
  node of PS/2 keyboards which is the 8042 controller (I have atkbdc(4)
  working that way).
- Use FBSDID.

MFC after: 1 month

19 years agoFor sparc64 conditionalize the compilation of the gfb_cursor() variant
marius [Sat, 21 May 2005 20:15:14 +0000 (20:15 +0000)]
For sparc64 conditionalize the compilation of the gfb_cursor() variant
which doesn't assume a hardware cursor on __sparc64__ rather than on
DEV_CREATOR. If we want to include more than one framebuffer driver in
e.g. the GENERIC kernel all drivers have to work the same way. Now that
DEV_CREATOR is no longer used remove it from options.sparc64.

19 years agoStart to address the race issue between restoring a file's contents
kientzle [Sat, 21 May 2005 19:45:56 +0000 (19:45 +0000)]
Start to address the race issue between restoring a file's contents
and restoring the metadata.  In particular, the metadata-restore
functions now all accept a file descriptor and a pathname.  If the
file descriptor is set and the platform supports the appropriate
syscall, restore the metadata through the file descriptor.  Otherwise,
restore it through the pathname.  This is complicated by varying
syscall support (FreeBSD has an fchmod(2) but no fchflags(2), for
example) and because non-file entries don't have an fd to use in
restoring attributes (for example, mknod(2) doesn't return a file
handle).

MFC after: 14 days

19 years agoCorrect return values in myopen() and myclose() in Example code.
kientzle [Sat, 21 May 2005 19:38:19 +0000 (19:38 +0000)]
Correct return values in myopen() and myclose() in Example code.

Bug: docs/79318
Thanks to: Derek Tattersall
MFC after: 7 days

19 years agoFix sentence structure to follow a better logic (zero is disable and
trhodes [Sat, 21 May 2005 17:22:12 +0000 (17:22 +0000)]
Fix sentence structure to follow a better logic (zero is disable and
one is enable).

19 years agoNI_WITHSCOPEID cleanup
ume [Sat, 21 May 2005 15:28:42 +0000 (15:28 +0000)]
NI_WITHSCOPEID cleanup

19 years agoSync program's usage() with manpage's SYNOPSIS.
ru [Sat, 21 May 2005 10:14:11 +0000 (10:14 +0000)]
Sync program's usage() with manpage's SYNOPSIS.

19 years agoSync program's usage() with manpage's SYNOPSIS.
ru [Sat, 21 May 2005 09:55:10 +0000 (09:55 +0000)]
Sync program's usage() with manpage's SYNOPSIS.

19 years agoSynchronize program's usage() with manpage's SYNOPSIS.
ru [Sat, 21 May 2005 07:08:32 +0000 (07:08 +0000)]
Synchronize program's usage() with manpage's SYNOPSIS.

19 years agoUnbreak handling of "ip[v]6" protocol and option flag. No more segfaults
mlaier [Sat, 21 May 2005 03:27:33 +0000 (03:27 +0000)]
Unbreak handling of "ip[v]6" protocol and option flag.  No more segfaults
and not every protocol is IPv6.

19 years agoReplace t_force with a t_flag (TF_FORCEDATA).
ps [Sat, 21 May 2005 00:38:29 +0000 (00:38 +0000)]
Replace t_force with a t_flag (TF_FORCEDATA).

Submitted by:   Raja Mukerji.
Reviewed by:    Mohan, Silby, Andre Opperman.

19 years agoQuick hack-o-rama to allow the Xorg Radeon driver to start up. It
grehan [Sat, 21 May 2005 00:22:57 +0000 (00:22 +0000)]
Quick hack-o-rama to allow the Xorg Radeon driver to start up. It
tries to mmap memory outside of the available BARs, so allow the
range checks to be relaxed with a sysctl.

19 years agoFor non-profiling kernels, there were two symbols assigned to the same
peter [Sat, 21 May 2005 00:02:12 +0000 (00:02 +0000)]
For non-profiling kernels, there were two symbols assigned to the same
address.  One was alltraps_with_regs_pushed, the other was calltrap.

When the stack tracer walks up, it looks for magic symbol names to
determine how to parse non-standard stack frames, such as a trapframe.
It was looking for "calltrap".  Which of the two symbols you got depended
on things like Phase of moon, etc.  If you were unlucky, you got a
garbage stack trace for things like 'debug.trace_on_panic', which would
completely hide the actual source of the problem.

19 years agoFix yet another cut-and-paste bug.
emax [Fri, 20 May 2005 23:29:55 +0000 (23:29 +0000)]
Fix yet another cut-and-paste bug.
kbd was allocated from M_VKBD not from M_DEVBUF

19 years agoReduce the number of times that we acquire and release locks in
alc [Fri, 20 May 2005 21:26:05 +0000 (21:26 +0000)]
Reduce the number of times that we acquire and release locks in
swap_pager_getpages().

MFC after: 1 week

19 years agoFix LINT build, original breakage was rev 1.23. There are 2 definitions
njl [Fri, 20 May 2005 17:16:24 +0000 (17:16 +0000)]
Fix LINT build, original breakage was rev 1.23.  There are 2 definitions
of MCOUNT to have a C version and an asm version with the same name and
not have LOCORE ifdefs to distinguish them.  <machine/profile.h> provides
a C version and <machine/asmacros.h> provides an assembler version.

Discussed with: bde

19 years agoAdjust the start_ap delay to match i386.
obrien [Fri, 20 May 2005 16:25:08 +0000 (16:25 +0000)]
Adjust the start_ap delay to match i386.

19 years agoFix mismerge in rev 1.226: wait 5 seconds as the comment documents,
obrien [Fri, 20 May 2005 16:23:15 +0000 (16:23 +0000)]
Fix mismerge in rev 1.226: wait 5 seconds as the comment documents,
not .5 seconds.

19 years agoreduce strlen() call.
ume [Fri, 20 May 2005 15:39:20 +0000 (15:39 +0000)]
reduce strlen() call.

19 years agoAdd a test to check whether in compat mode make detectes builtins
harti [Fri, 20 May 2005 15:25:04 +0000 (15:25 +0000)]
Add a test to check whether in compat mode make detectes builtins
on the command line and really executes the shell instead of directly
executing the command.

19 years agouse reentrant.h and simplify.
ume [Fri, 20 May 2005 15:17:08 +0000 (15:17 +0000)]
use reentrant.h and simplify.

19 years agoAdd a test to ensure that in compat mode when a line contains no
harti [Fri, 20 May 2005 15:06:27 +0000 (15:06 +0000)]
Add a test to ensure that in compat mode when a line contains no
shell meta characters it is not passed to the shell, but the command
is executed directly (given that the line is not a shell builtin) and
that the line with a meta character is passed to the shell.

19 years agocheck return value of ttyname_r().
ume [Fri, 20 May 2005 14:59:20 +0000 (14:59 +0000)]
check return value of ttyname_r().

19 years agottyname_r() didn't pass correct buffer size to devname_r().
ume [Fri, 20 May 2005 14:56:55 +0000 (14:56 +0000)]
ttyname_r() didn't pass correct buffer size to devname_r().

19 years agoAdd a test that test whether we can replace the shell to use by
harti [Fri, 20 May 2005 14:50:30 +0000 (14:50 +0000)]
Add a test that test whether we can replace the shell to use by
make with another shell and set all its parameters (meta and builtins
not tested here).

19 years agoRemove unused variables. Remove prototype for function that does not exist.
charnier [Fri, 20 May 2005 13:14:18 +0000 (13:14 +0000)]
Remove unused variables. Remove prototype for function that does not exist.

19 years agoRemove unused variables.
charnier [Fri, 20 May 2005 13:09:49 +0000 (13:09 +0000)]
Remove unused variables.

19 years agoRemove unused variables. int -> size_t for lenghts.
charnier [Fri, 20 May 2005 13:04:10 +0000 (13:04 +0000)]
Remove unused variables. int -> size_t for lenghts.

19 years agoAdd FBSDID. Add missing prototypes. Remove unused variables. Give variable
charnier [Fri, 20 May 2005 13:01:47 +0000 (13:01 +0000)]
Add FBSDID. Add missing prototypes. Remove unused variables. Give variable
an initial value to silent compiler.

19 years agoRemove unused variable.
charnier [Fri, 20 May 2005 12:57:01 +0000 (12:57 +0000)]
Remove unused variable.

19 years agoRemove unused variable. Shorten the path to WARNS=6 compliance.
charnier [Fri, 20 May 2005 12:55:38 +0000 (12:55 +0000)]
Remove unused variable. Shorten the path to WARNS=6 compliance.

19 years agoRemove unused variables. Shorten the path to a WARNS=6 compliance.
charnier [Fri, 20 May 2005 12:50:47 +0000 (12:50 +0000)]
Remove unused variables. Shorten the path to a WARNS=6 compliance.

19 years agoRemove unused variables. Whitespace cleaning.
charnier [Fri, 20 May 2005 12:46:34 +0000 (12:46 +0000)]
Remove unused variables. Whitespace cleaning.

19 years agoRemove unused variables
charnier [Fri, 20 May 2005 12:44:04 +0000 (12:44 +0000)]
Remove unused variables

19 years agoRecognize the integrated (though not necessarily enabled) FireWire
marius [Fri, 20 May 2005 12:37:16 +0000 (12:37 +0000)]
Recognize the integrated (though not necessarily enabled) FireWire
controllers of Sun PCIO-2 chips which are used onboard in most of
the newer PCI-based sun4u machines (cosmetic change as they were also
already probed as generic FWOHCI without this). As with gem(4), hme(4)
and ohci(4) detect whether their intpin register is valid and correct
it if necessary, i.e. set the respective IVAR to the right value for
allocating the IRQ resource, as some of them come up having it set
to 0 (in fact in all machines I'm currently aware of the FireWire
part being enabled). This fixes attaching affected controllers.

Apporved by: simokawa
Tested by: Michiel Boland <michiel@boland.org>
MFC after: 1 month

19 years agoCalling xl_rxeof() at the end of xl_start_locked() leads to recursion
glebius [Fri, 20 May 2005 07:16:09 +0000 (07:16 +0000)]
Calling xl_rxeof() at the end of xl_start_locked() leads to recursion
in case of IP fast forwarding. Enqueue a taskqueue(9) task instead of
calling xl_rxeof() directly.

Reported & tested by: Slava Alpatov
Reviewed by: wpaul
MFC after: 1 week

19 years agoPrint the rigth argv string on error (too much c&p)..
sos [Fri, 20 May 2005 06:23:40 +0000 (06:23 +0000)]
Print the rigth argv string on error (too much c&p)..

19 years agoAdd OpenBSD 3.7.
maxim [Fri, 20 May 2005 05:13:25 +0000 (05:13 +0000)]
Add OpenBSD 3.7.

19 years agoDocument that the returned pointer should be freed even if the number
njl [Fri, 20 May 2005 05:04:22 +0000 (05:04 +0000)]
Document that the returned pointer should be freed even if the number
of items returned is 0.

19 years agoIf devclass_get_devices() returns success but a count of 0, free the
njl [Fri, 20 May 2005 05:00:43 +0000 (05:00 +0000)]
If devclass_get_devices() returns success but a count of 0, free the
pointer.  If kernel malloc(0) returns a valid pointer, it needs to be
freed.  If it returns NULL, it's ok to free this also.

Submitted by: pjd
Reviewed by: imp, dfr
Obtained from: Coverity Prevent

19 years agoNew release notes: libalias as kernel module, ng_nat(4), sed(1) -l,
bmah [Fri, 20 May 2005 04:19:56 +0000 (04:19 +0000)]
New release notes:  libalias as kernel module, ng_nat(4), sed(1) -l,
ATA mkIII, chflags(1) -h, kldstat(8) -m, what(1) -q, GNU grep patches
from Fedora.

19 years agoMissed kern_windrv.c in the last checkin.
wpaul [Fri, 20 May 2005 04:01:36 +0000 (04:01 +0000)]
Missed kern_windrv.c in the last checkin.

19 years agoDeal with a few bootstrap issues:
wpaul [Fri, 20 May 2005 04:00:50 +0000 (04:00 +0000)]
Deal with a few bootstrap issues:

We can't call KeFlushQueuedDpcs() during bootstrap (cold == 1), since
the flush operation sleeps to wait for completion, and we can't sleep
here (clowns will eat us).

On an i386 SMP system, if we're loaded/probed/attached during bootstrap,
smp_rendezvous() won't run us anywhere except CPU 0 (since the other CPUs
aren't launched until later), which means we won't be able to set up
the GDTs anywhere except CPU 0. To deal with this case, ctxsw_utow()
now checks to see if the TID for the current processor has been properly
initialized and sets up the GTD for the current CPU if not.

Lastly, in if_ndis.c:ndis_shutdown(), do an ndis_stop() to insure we
really halt the NIC and stop interrupts from happening.

Note that loading a driver during bootstrap is, unfortunately, kind of
a hit or miss sort of proposition. In Windows, the expectation is that
by the time a given driver's MiniportInitialize() method is called,
the system is already in 'multiuser' state, i.e. it's up and running
enough to support all the stuff specified in the NDIS API, which includes
the underlying OS-supplied facilities it implicitly depends on, such as
having all CPUs running, having the DPC queues initialized, WorkItem
threads running, etc. But in UNIX, a lot of that stuff won't work during
bootstrap. This causes a problem since we need to call MiniportInitialize()
at least once during ndis_attach() in order to find out what kind of NIC
we have and learn its station address.

What this means is that some cards just plain won't work right if
you try to pre-load the driver along with the kernel: they'll only be
probed/attach correctly if the driver is kldloaded _after_ the system
has reached multiuser. I can't really think of a way around this that
would still preserve the ability to use an NDIS device for diskless
booting.

19 years agoguard against bogus address data
sam [Fri, 20 May 2005 03:58:53 +0000 (03:58 +0000)]
guard against bogus address data

Submitted by: Bakul Shah

19 years agoFix libstand on amd64. Rev 1.46 (obrien) removed the -I. that the
peter [Fri, 20 May 2005 03:18:19 +0000 (03:18 +0000)]
Fix libstand on amd64.  Rev 1.46 (obrien) removed the -I. that the
bzip2 support provided, and amd64 depended on.  Amd64 has a custom
${.OBJDIR}/machine symlink in it and the -I. picked this up.  Without
it, the libstand code was being compiled in 32 bit mode, but with 64 bit
machine headers.

19 years agoIn ndis_halt_nic(), invalidate the miniportadapterctx early to try and
wpaul [Fri, 20 May 2005 02:35:43 +0000 (02:35 +0000)]
In ndis_halt_nic(), invalidate the miniportadapterctx early to try and
prevent anything from making calls to the NIC while it's being shut down.
This is yet another attempt to stop things like mdnsd from trying to
poke at the card while it's not properly initialized and panicking
the system.

Also, remove unneeded debug message from if_ndis.c.

19 years agoDocument support for the 5714.
brueffer [Fri, 20 May 2005 01:20:23 +0000 (01:20 +0000)]
Document support for the 5714.

MFC after: 3 days

19 years agoAdd nve(4).
brueffer [Fri, 20 May 2005 01:19:02 +0000 (01:19 +0000)]
Add nve(4).

19 years agoExtend `autoboot_delay' handling - is this variable is set to -1 don't allow
sobomax [Thu, 19 May 2005 23:03:02 +0000 (23:03 +0000)]
Extend `autoboot_delay' handling - is this variable is set to -1 don't allow
user to interrupt autoboot process at all. Currently, even when
`autoboot_delay' is set to 0, loader(8) still allows autoboot process to be
interrupted by pressing any key on the console when the loader reads kernel
and modules from the disk. In some cases (i.e. untrusted environment) such
behaviour is highly indesirable and user should not be allowed to interfere
with the autoboot process at all.

Sponsored by: PBXpress Inc.
MFC after: 3 days

19 years agoRecognize the integrated USB controllers of Sun PCIO-2 chips which
marius [Thu, 19 May 2005 23:00:46 +0000 (23:00 +0000)]
Recognize the integrated USB controllers of Sun PCIO-2 chips which
are used onboard in most of the newer PCI-based sun4u machines
(cosmetic change as they were also already probed as generic OHCI
without this). Detect whether their intpin register is valid and
correct it if necessary, i.e. set the respective IVAR to the right
value for allocating the IRQ resource, as some of them come up
having it set to 0 (mainly those used in Blade 100 and the first
one on AX1105 boards). This fixes attaching affected controllers.
Correcting the intpin value might be better off in the PCI code
via a quirk table but on the other hand gem(4) and hem(4) also
correct it themselves and at least for the USB controller part
the intpin register is truely hardwired to 0 and can't be changed.
This means that we would have to hook up the quirk information
in a lot of places in the PCI code (i.e. whenever the value of the
intpin register is read from or written to the pci_devinfo of the
respective device) in order to do it the right way.

MFC after: 1 month

19 years agoSync with the other files.<arch> files and put the keyboard map
marius [Thu, 19 May 2005 22:56:00 +0000 (22:56 +0000)]
Sync with the other files.<arch> files and put the keyboard map
generation stuff at the beginning of this file as well as add a
dependency on dev/kbd/kbd.c for ukbd(4).

19 years agoCorrect a few places where we called warn() when warnx() should have
mux [Thu, 19 May 2005 21:33:48 +0000 (21:33 +0000)]
Correct a few places where we called warn() when warnx() should have
been used.

Submitted by: "Liam J. Foy" <liamfoy@sepulcrum.org>
Obtained from: DragonFlyBSD

19 years agoo mc146818(4):
marius [Thu, 19 May 2005 21:20:42 +0000 (21:20 +0000)]
o mc146818(4):
  - Add locking.
  - Account for if the MC146818_NO_CENT_ADJUST flag is set we don't need
    to check wheter year < POSIX_BASE_YEAR.
  - Add some comments about mapping the day of week from the range the
    generic clock code uses to the range the chip uses and which I meant
    to add in the initial version.
  - Minor clean-up, use __func__ instead of hardcoded function names in
    error strings.

o in the rtc(4) front-end additionally:
  - Don't leak resources in case mc146818_attach() fails.
  - Account for ebus(4) defaulting to SYS_RES_MEMORY for the memory
    resources since ebus.c rev. 1.22.

19 years ago- Add locking.
marius [Thu, 19 May 2005 21:16:50 +0000 (21:16 +0000)]
- Add locking.
- Add support for storing the century in MK48TXX_WDAY_CB on MK48Txx with
  extended registers when the MK48TXX_NO_CENT_ADJUST flag is set (and which
  is termed somewhat confusing as it actually means don't manually adjust
  the century in the driver).
- Add the MI part of interfacing the watchdog functionality of MK48Txx with
  extended registers with watchdog(9). This is inspired by the SunOS/Solaris
  drivers for the 'eeprom' devices also having watchdog support. I actually
  expected this to work out of the box on Sun Exx00 machines with 'eeprom'
  devices which have a 'watchdog-enable' property. On terminal count of the
  the watchdog timer however only the MK48TXX_FLAGS_WDF bit rises but the
  reset signal and the interrupt respectively (depending on whether the
  MK48TXX_WDOG_WDS bit of the chip and the MK48TXX_WDOG_ENABLE_WDS flag
  of the driver respectively is set) goes nowhere. Apparently passing the
  reset signal on to the WDR line of the CPUs has to be enabled somewhere
  else but we don't have documentation for the Exx00 specific controllers.
  I decided to commit this nevertheless so it can be enabled in the eeprom(4)
  front-end later in e.g. 6.0-STABLE without breaking the API. Besides the
  Exx00 the watchdog part of the MK48Txx should also work on E250 and E450.
  Possibly also without extra fiddling on these machines but I haven't
  found someone willing to give it a try on such a machine so far.
- Use uintXX_t instead of u_intXX_t, use __func__ instead of hardcoded
  function names in error strings.

19 years agoAdd cases for ENOBUFS and ENETDOWN. We need to make sure that we
csjp [Thu, 19 May 2005 21:09:44 +0000 (21:09 +0000)]
Add cases for ENOBUFS and ENETDOWN. We need to make sure that we
catch all transient errors. This fixes situations where transient
error conditions such as network interfaces losing carrier signals
or the system running out of mbufs would result in the permanent
removal of forwarding syslog messages.

MFC after: 1 week

19 years agoSupport the 5714C
ps [Thu, 19 May 2005 21:08:59 +0000 (21:08 +0000)]
Support the 5714C

Submitted by: John Cagle <john dot cagle at hp dot com>

19 years agoDocument taskqueue_drain().
glebius [Thu, 19 May 2005 18:31:42 +0000 (18:31 +0000)]
Document taskqueue_drain().

19 years ago- Collapse eeprom_ebus.c and eeprom_sbus.c into eeprom.c and
marius [Thu, 19 May 2005 18:15:37 +0000 (18:15 +0000)]
- Collapse eeprom_ebus.c and eeprom_sbus.c into eeprom.c and
  eeprom_ebus_attach() and eeprom_sbus_attach() into eeprom_attach()
  respectively. Since the introduction of the ofw_bus interface some
  time ago and now that ebus(4) also uses SYS_RES_MEMORY for the
  memory resources since ebus.c rev. 1.22 there is no longer a
  need to have separate front-ends for ebus(4), fhc(4) and sbus(4).
- Fail gracefully instead of panicing when the model can't be
  determined.
- Don't leak resources when mk48txx_attach() fails.
- Use FBSDID.

19 years agoTake advantage of ebus(4) having switched to SYS_RES_MEMORY for the
marius [Thu, 19 May 2005 18:13:49 +0000 (18:13 +0000)]
Take advantage of ebus(4) having switched to SYS_RES_MEMORY for the
memory resources in ebus.c rev. 1.22 and treat both the EBus and SBus
variants alike in this regard.

Ok'ed by: yongari

19 years ago- Artificially using SYS_RES_IOPORT for EBus devices for reasons of
marius [Thu, 19 May 2005 18:11:46 +0000 (18:11 +0000)]
- Artificially using SYS_RES_IOPORT for EBus devices for reasons of
  compatibility with ISA devices while in fact all known EBus devices
  actually use memory space turned out to be not a good idea as so far
  there is only the 'rtc' device known to show up either on an EBus or
  ISA bus but not on any of the other busses used on sparc64. However
  there are quite a couple of them that show up on either EBus, FireHose
  or SBus. In order to save extra code in the respective drivers switch
  ebus(4) to actually use SYS_RES_MEMORY for the memory resources of
  its children. At least for transition still accept SYS_RES_IOPORT
  and silently change it to SYS_RES_MEMORY. [1]
- In ebus_probe() use ofw_bus_get_name() instead of re-implementing it
  via ofw_bus_get_node() and OF_getprop().
- Remove some unused variables.
- Use FBSDID.

Discussed with: tmm (some time ago)

19 years ago- When iterating over the register resources of the children don't use
marius [Thu, 19 May 2005 15:47:37 +0000 (15:47 +0000)]
- When iterating over the register resources of the children don't use
  the iteration variable as the RID when adding the respective resource
  to the child via bus_set_resource(). In case a device has both I/O
  and memory resources this generates gaps in the newbus resources of
  the child, e.g. its first memory resource might end up as RID 1.
  To solve this mimic resource_list_add_next() via resource_list_find()
  and bus_set_resource(); we can't just use resource_list_add_next()
  here as this would circumvent the limit checks in isa_set_resource()
  of the common ISA code.
  This however is more or less a theoretical problem so far as all known
  ISA devices on sparc64 soley use I/O space.
- Just use bus_generic_rl_release_resource() for isa_release_resource()
  instead of re-implementing the former.
- Improve some comments to better reflect reality, minor clean-up and
  simplifications, return NULL instead of 0 were appropriate.

19 years agoMake the path to make.conf a parameter which can be overridden.
phk [Thu, 19 May 2005 15:34:36 +0000 (15:34 +0000)]
Make the path to make.conf a parameter which can be overridden.

NB: you have to use absolute path!

19 years agoSave space by using -b 4096 -f 512 for newfs.
phk [Thu, 19 May 2005 15:34:00 +0000 (15:34 +0000)]
Save space by using -b 4096 -f 512 for newfs.
Retain -i 8192 to avoid wasting inodes.

19 years agoRun the "files" customization script
phk [Thu, 19 May 2005 15:24:23 +0000 (15:24 +0000)]
Run the "files" customization script

19 years agoAdd some runtime admin/tool scripts
phk [Thu, 19 May 2005 15:23:47 +0000 (15:23 +0000)]
Add some runtime admin/tool scripts

19 years agoSync with openfirm(4) and check the return value of malloc() although
marius [Thu, 19 May 2005 15:23:17 +0000 (15:23 +0000)]
Sync with openfirm(4) and check the return value of malloc() although
this isn't exactly necessary with M_WAITOK.

19 years agoUpdate the names of some member variables in comments to refect reality.
marius [Thu, 19 May 2005 15:22:16 +0000 (15:22 +0000)]
Update the names of some member variables in comments to refect reality.
Apparently this was forgotten when this code was derived from the BSD
openprom(4).

19 years agoAdd a couple of basic customization scripts.
phk [Thu, 19 May 2005 15:20:49 +0000 (15:20 +0000)]
Add a couple of basic customization scripts.

19 years ago- Add suport for the bus_get_resource() device interface method to
marius [Thu, 19 May 2005 15:09:56 +0000 (15:09 +0000)]
- Add suport for the bus_get_resource() device interface method to
  central(4) and fhc(4) by using bus_generic_rl_get_resource().
- Remove some superfluous breaks in central.c

19 years agoAdd nve(4).
brueffer [Thu, 19 May 2005 15:01:44 +0000 (15:01 +0000)]
Add nve(4).

19 years agoDirectly link to the nve(4) manpage.
brueffer [Thu, 19 May 2005 14:59:21 +0000 (14:59 +0000)]
Directly link to the nve(4) manpage.

19 years ago- Connect nve(4)
brueffer [Thu, 19 May 2005 14:54:48 +0000 (14:54 +0000)]
- Connect nve(4)
- Correct sorting order

Suggested and reviewed by: ru

19 years agoManpage for the nve NVIDIA nForce MCP Ethernet driver. The manpage is based
brueffer [Thu, 19 May 2005 14:52:42 +0000 (14:52 +0000)]
Manpage for the nve NVIDIA nForce MCP Ethernet driver.  The manpage is based
on the nvnet driver manpage by Quinton Dolan.

Especially the list of supported hardware needs some work.

19 years ago- Try to not leak resources in the attach functions of the esp(4) SBus
marius [Thu, 19 May 2005 14:51:10 +0000 (14:51 +0000)]
- Try to not leak resources in the attach functions of the esp(4) SBus
  front-end and the LSI64854 and NCR53C9x code in case one of these
  functions fails. Add detach functions to these parts and make esp(4)
  detachable.
- Revert rev. 1.7 of esp_sbus.c, since rev. 1.34 of sbus.c the clockfreq
  IVAR defaults to the per-child values.
- Merge ncr53c9x.c rev. 1.111 from NetBSD (partial):
  On reset, clear state flags and the msgout queue.
  In NetBSD code to notify the upper layer (i.e. CAM in FreeBSD) on reset
  was also added with this revision. This is believed to be not necessary
  in FreeBSD and was not merged.
  This makes ncr53c9x.c to be in sync with NetBSD up to rev. 1.114.
- Conditionalize the LSI64854 support on sbus(4) only instead of sbus(4)
  and esp(4) as it's also required for the 'dma', 'espdma' and 'ledma'
  busses/devices as well as the 'SUNW,bpp' device (printer port) which
  all hang off of sbus(4).
- Add a driver for the 'dma', 'espdma' and 'ledma' (pseudo-)busses/
  devices. These busses and devices actually represent the LSI64854 DMA
  engines for the ESP SCSI and LANCE Ethernet controllers found on the
  SBus of Ultra 1 and SBus add-on cards. With 'espdma' and 'ledma' the
  'esp' and 'le' devices hang off of the respective DMA bus instead of
  directly from the SBus. The 'dma' devices are either also used in this
  manner or on some add-on cards also as a companion device to an 'esp'
  device which also hangs off directly from the SBus. With the latter
  variant it's a bit tricky to glue the DMA engine to the core logic of
  the respective 'esp' device. With rev. 1.35 of sbus.c we are however
  guaranteed that such a 'dma' device is probed before the respective
  'esp' device which simplifies things a lot. [1]
- In the esp(4) SBus front-end read the part-unique ID code of Fast-SCSI
  capable chips the right way. This fixes erroneously detecting some
  chips as FAS366 when in fact they are not. Add explicit checks for the
  FAS100A, FAS216 and FAS236 variants instead treating all of these as
  ESP200. That way we can correctly set the respective Fast-SCSI config
  bits instead of driving them out of specs. This includes adding the
  FAS100A and FAS236 variants to the NCR53C9x core code. We probably
  still subsume some chip variants as ESP200 while in fact they are
  another variant which however shouldn't really matter as this will
  only happen when these chips are driven at 25MHz or less which implies
  not being able to run Fast-SCSI. [3]
- Add a workaround to the NCR53C9x interrupt handler which ignores the
  stray interrupt generated by FAS100A when doing path inquiry during
  boot and which otherwiese would trigger a panic.
- Add support for the 'esp' devices hanging off of a 'dma' or 'espdma'
  busses or which are companions of 'dma' devices to esp(4). In case of
  the variants that hang off of a DMA device this is a bit hackish as
  esp(4) then directly uses the softc of the respective parent to talk
  to the DMA engine. It might make sense to add an interface for this
  in order to implement this in a cleaner way however it's not yet clear
  how the requirements for the LANCE Ethernet controllers are and the
  hack works for now. [2]
  This effectively adds support for the onboard SCSI controller in
  Ultra 1 as well as most of the ESP-based SBus add-on cards to esp(4).
  With this the code for supporting the Performance Technologies SBS430
  SBus SCSI add-on cards is also largely in place the remaining bits
  were however omitted as it's unclear from the NetBSD how to couple
  the DMA engine and the core logic together for these cards.

Obtained from: OpenBSD [1]
Obtained from: NetBSD [2]
Clue from: BSD/OS [3]
Reviewed by: scottl (earlier version)
Tested with: FSBE/S add-on card (FAS236), SSHA add-on card (ESP100A),
Ultra 1 (onboard FAS100A), Ultra 2 (onboard FAS366)

19 years ago- Add an IVAR for retrieving the interrupt group number of the parent Sbus
marius [Thu, 19 May 2005 14:47:31 +0000 (14:47 +0000)]
- Add an IVAR for retrieving the interrupt group number of the parent Sbus
  device and which also applies to the children. This is very usefull for
  drivers for the various subordinate busses so they don't need to fiddle
  with the OFW node of their parent themselves. As SBus busses hang of the
  nexus and we don't use the ofw_bus interface for nexus devices, yet, this
  would also require special knowledge about this in the drivers for the
  SBus children which these shouldn't need to have.
  This includes switching to use an unshifted IGN in the sc_ign member of
  the sbus(4) softc internally.
- For SBus child devices where there are variants that are actually split
  split into two SBus devices (as opposed to the first half of the device
  being a SBus device and the second half hanging off of the first one)
  like 'auxio' and 'SUNW,fdtwo' or 'dma' and 'esp' probe the SBus device
  which is a prerequisite to the driver attaching to the second one with
  a lower order. This saves us from dealing with different probe orders
  in the respective device drivers which generally is more hackish.
- Remove a stale comment about the 'specials' array above the attaching
  of the child devices. This is a remnant of the NetBSD/sparc origin of
  this code. There the 'specials' array is also used to probe certain
  devices which are prerequisites to others first. Why NetBSD soley
  relies on the devices having the expected order in the OFW tree on
  sparc64 isn't clear to me, as far as I can tell OFW doesn't guaranteed
  such things.

19 years agoSA-05.09.htt only applies to i386 and amd64, so conditionalize
bmah [Thu, 19 May 2005 14:43:20 +0000 (14:43 +0000)]
SA-05.09.htt only applies to i386 and amd64, so conditionalize
appropriately.

19 years agoCatch up on some low-hanging fruit...
bmah [Thu, 19 May 2005 14:33:44 +0000 (14:33 +0000)]
Catch up on some low-hanging fruit...

New release notes: SA-05:09.htt, awk 20050424, bzip2 1.0.3, libregex
from a glibc CVS snapshot, pf from OpenBSD 3.7.

Updated release notes:  lukemftp 20050219.

19 years agoThe 'text' argument of u_header() is not used, so we don't need to
keramida [Thu, 19 May 2005 13:34:19 +0000 (13:34 +0000)]
The 'text' argument of u_header() is not used, so we don't need to
trim_header() it.

Noticed by: bde

19 years agoExplain the magic
phk [Thu, 19 May 2005 13:33:21 +0000 (13:33 +0000)]
Explain the magic

19 years agoSome test cases for .SHELL target: builtin shell selection and
harti [Thu, 19 May 2005 11:23:01 +0000 (11:23 +0000)]
Some test cases for .SHELL target: builtin shell selection and
changing the path of a builtin shell.

19 years agoUse General definition for general notify.
takawata [Thu, 19 May 2005 09:13:26 +0000 (09:13 +0000)]
Use General definition for general notify.

19 years agoAlign the stack to a 16 byte boundary so that we can safely call functions
dfr [Thu, 19 May 2005 07:36:07 +0000 (07:36 +0000)]
Align the stack to a 16 byte boundary so that we can safely call functions
that use SSE. The compiler does attempt to do this in main() but not very
successfully - it still manages to use unaligned offsets from %ebp in some
cases. Also we need to have an aligned stack in case something uses SSE
via _init().

MFC After: 1 week