this results in a few functions becoming static, and
the SYSINITs being close to the code they are related to.
setting up the dump device is with dumpsys() and
kicking off the scheduler is with the scheduler.
Mounting root is with the code that does it.
Reviewed by: phk
Sorted the functions into the same order as in ufs_vnops.c so that this
can be compared with the latter without getting 2627 lines of diffs.
Now we get only 1920 lines of diffs.
"high resolution" profiling. The available clocks are:
- the i8254 clock
- on non-SMP i586's and i686's: the TSC
- on systems with I586_PMC_GUPROF configured, and PERFMON configured
and available: all the performance counters.
This is unfinshed (there are problems with locking out the PERFMON
device driver, and with losing calibration after switching the clock),
but better than static configuration or writing to kmem.
Changed ifdefs to avoid generating code for non-working option
combinations.
triple indirect blocks only worked for block sizes of 4K, since
MNINDIR(ump)**3 overflows for larger block sizes (e.g.,
(8192/4)**3 = 2**33 > INT_MAX). This fix is not the obvious one of
changing some types to 64 bits. It rearranges the code to avoid some
unnecessary 64-bit calculations.
Reviewed by: Kirk McKusick <mckusick@McKusick.COM>
a mistake (since softnet interrupts may occur if malloc() waits),
and doing it harmlessly but unnecessarily here interfered with
detection of the mistaken cases.
b_flags, and this patch removes unneeded modifications. Only the needed b_flags
bits are modified now. (Specifically, it is usually wrong to zero b_flags.)
Submitted by: bde@freebsd.org
Fixed overflow of FFLAGS() in fcntl(F_SETFL, ...). This was not
a security hole, but gave wrong results for silly flags values.
E.g., it make fcntl(F_SETFL, -1) equivalent to fcntl(F_SETFL, 0).
POSIX requires ignoring the open mode bits in fcntl() (even if
they would be invalid for open()).
break for the usual sector size. dscheck() adjusts b_bcount to
handle EOF, so we must scale it and not preserve it. i/o beyond
the end of partitions has been broken since rev.1.96.
Not fixed in: od driver
are used in the `#ifdef notyet' case :-). This case is used except in
the `#if !defined (not_yes)' case :-|. This has something to do with
the `#ifdef notyet_block_reallocation_enabled' case in vfs_cluster.c :-(.
Use OID_AUTO instead of a magic number for the debug.syncprt sysctl.
(This sysctl doesn't actually work. FreeBSD nuked it, but parts
of it were mismerged from Lite2. It is not very good, but better
than nothing.)
`mount -u'. This only matters for `mount -u' competing with unmounts.
If I understand the locking correctly: if mount() blocks, then unmount()
may run and set mp->kern_flag for the same mp. Then unmount() blocks
waiting for mount() to finish. When unmount() continues, its MNTK flags
(MNTK_UNMOUNT and MNTK_MWAIT) may have been clobbered.
Didn't fix old bugs:
- restoring mp->mnt_kern_flag is wrong for the same reasons in the error
case.
- the error case of unmount() seems to be broken too:
(a) MNTK_UNMOUNT gets clobbered, although another unmount() may have
set it. Perhaps it shouldn't be set until after the full lock is
aquired.
(b) MNTK_MWAIT isn't honoured.
Fixed a nearby style bug.
time, but was left at 0. This caused the "can't happen" case in
splz_swi to happen for panics when tsleep() calls splx(safepri)
and there is a SWI_AST pending. This was harmless because the
the error handling happens to be right. Debugging this was tricky
because debugger traps force SWI_AST_MASK on in `cpl'.
there is a natural place to initialize `safepri' in a future commit.
Spinoffs:
- spl0() gets called in the unlikely event that isa is not configured.
- configure() has better control over enabling interrupts.
- it is now less unclear that interrupts aren't actually enabled early.
Rev.1.48 of autoconf.c seems to have done the opposite of what was
intended - moving the isa_configure() call delayed the spl0() side
effect.
Added some comments about the bogons. Removed the splhigh() call since
it is a no-op.
checking the BIOS video mode paramter table. Now syscons uses the
parameter table even if some bits in the table are different from the
current VGA register settings.
Even if comp_vgaregs() finds that the BIOS video parameter table looks
totally unfamiliar to it, syscons allows the user to change the
current video mode to some modes which are based on the VGA 80x25
mode. They are VGA 80x30, VGA 80x50, VGA 80x60. In this case the user
will be warned, during boot, that video mode switching is only
paritally supported on his machine.
PR: bin/4477
this mouse can correctly operate only in the high resolution mode.
If the mouse pointer jumps to the top or left edge or the top-left
corner of the screen, try defining PSM_MSCKLUDGE in the kernel
configuration file. This option will put the mouse in the high
resolution mode during device initialization.
Disallow wait options that are not a combination of the standard POSIX
options WUNTRACED and WNOHANG, as is required by POSIX. BSD doesn't
have any extensions here, but the code was `#ifdef notyet' for some
reason.
interval [VM_MIN_KERNEL_ADDRESS, etext] was used instead of
[btext, etext). Added a comment about this being completely
wrong for LKMs. This only affects interpreting the instructions
after the return to attempt decide the number of args. The
attempt usually fails anyway.
checking was mostly wrong at the boundaries. For the lower limit,
VM_MIN_KERNEL_ADDRESS was used instead of btext and there was an
off-by-(`size' - 1) error. For the upper limit, &etext was used
instead of etext and there was an off-by-1 error. The bugs were
harmless because `size' is not too large and some memory is mapped
just beyond the ends. We still depend on the former to avoid
having to handle the case where the memory range covers the whole
text section, and on the latter to prevent problems when we map
just beyond an end to allow writing an address range that overlaps
the end.
Fixed placement of a nearby comment.
one traditionally reserved for swap devices. The restrictions
should now be the same as the ones for dumpsys(). The restriction
on the partition should be removed someday, and dumpsys() shouldn't
repeat all the checks.
it if the file system is mounted noatime). Not fixed: the access
time is marked at the start of a read() and not marked on successful
completion. I think this should be handled at the vfs level.
Print a better panic message for missing vops. Don't use printf()
before panic(), since the printf()ed part isn't shown by gdb.
This actually loses a little with the current gdb, since gdb just
prints the fmt arg to panic, so %'s aren't expanded. gdb should
fetch the full message from the message buffer if possible.
Fixed default vop function for vop_getpages_desc. It needs to
just return EOPNOTSUPP so that the vnode pager can get the pages
in using a general method. Panicing broke exec'ing of files on
ext2fs file systems. ffs works because it doesn't use the default.
Fixed nearby style bugs.
Fixed nonblocking mode. It was per-device instead of per-file. This
also fixes clobbering of bd_rtout by overloading it to hold a wrong
version of the blocking flag. I hope nothing depends on the bugs.
Fixed nonblocking mode. It was per-device instead of per-file.
Don't depend on gcc's misfeature of rewriting char args in old-style
function definitions to match wrong prototypes. Break K&R1 support
to fix this quickly.
Testing in if_ppp.c is good enough.
Added comments about bogus #includes and #defines.
Removed unused #includes.
Don't depend on gcc's misfeature of rewriting short args in old-style
function definitions to match wrong prototypes. I just changed the
function definition to match the prototype, since this is easy to
verify automatically (it causes no changes in the object code), but
it breaks K&R1 support and doesn't fix the pessimal type.
Use gettime() instead of microtime() to set if_lastchange for i/o's.
microtime() is probably too expensive. However, setting if_lastchange
for i/o's may be wrong.
volatile to use outside of splclock(). microtime() is probably too
expensive to use for every i/o. However, setting ifi_lastchange for
every i/o is just wrong according to the comment about ifi_lastchange
in <net/if.h>. It is set then for atm, fddi and the latest version
of ppp.)
and don't include <sys/fcntl.h>. (The select -> poll changes replaced
fcntl macros by poll macros.)
Use <machine/*.h> instead of <i386/include/*.h>.
Fail the probe instead of crashing in the unlikely event that malloc()
fails.
Fixed #include order. <i386/isa/isa_device.h> will soon be a prerequisite
for <i386/isa/pnp.h>. Including both in alphebetical order gets this
right naturally.
years and gives a "laugh"able number of compile-time errors (see the
comment). main() just printed the struct sizes. This can be done
better by compiling with -g and reading off the sizes from the stabs.
Sorted #includes.
Fixed an unsigned vs signed comparison.
place that depended on it. The "bazillion warnings" mentioned in the
log for rev.1.45 apparently aren't a problem any more. It is hard
to be sure because the SIMPLELOCK_DEBUG option turns off (and breaks)
things in the SMP case.
place that depended on it. The "bazillion warnings" mentioned in the
log for rev.1.45 apparently aren't a problem any more. It is hard
to be sure because the SIMPLELOCK_DEBUG option turns off (and breaks)
things in the SMP case.
Don't forward declare structs that are already implicitly forward declared.
Fixed a disordered declaration.
to fix some broken application. Application breakage is now hidden by a
recently introduced wrong #include of <sys/types.h> in <sys/time.h>.
<sys/time.h> is a prerequisite for <sys/resource.h>, so the <sys/types.h>
prereqisite is automatically supplied.
Cast RLIM_INFINITY to the correct (signed) type.
LINUX_SNDCTL_DSP_GETOPTR
LINUX_SNDCTL_DSP_GETIPTR
LINUX_SNDCTL_DSP_SETTRIGGER
LINUX_SNDCTL_DSP_GETCAPS
With this rev level the linux realaudio player 5 and xquake should work.
(update_intr_masks might not need to be done in 3.X, but the new generic
interrupt code is incomplete w/regard to support for the PCCARD code, so
to avoid any potential problems use it. It can't hurt).
- Correctly register pcic_imask with the system interrupt code.
- Call update_intr_masks() so that pcic_imask modifications that occur
when card interrupts are registered get updated in the system
interrupt code.
close small security hole where an atacker could sendpackets with
IPDIVERT protocol, and select how it would be diverted thus bypassing
the ipfirewall. Discovered by inspection rather than attack.
(you'd have to know how the firewall was configured (EXACTLY) to
make use of this but..)
Obtained from: Whistle Communications tree
Add an option to the way UFS works dependent on the SUID bit of directories
This changes makes things a whole lot simpler on systems running as
fileservers for PCs and MACS. to enable the new code you must
1/ enable option SUIDDIR on the kernel.
2/ mount the filesystem with option suiddir.
hopefully this makes it difficult enough for people to
do this accidentally.
see the new chmod(2) man page for detailed info.
Ever since I first say the way the mount flags were used I've hated the
fact that modes, and events, internal and exported, and short-term
and long term flags are all thrown together. Finally it's annoyed me enough..
This patch to the entire FreeBSD tree adds a second mount flag word
to the mount struct. it is not exported to userspace. I have moved
some of the non exported flags over to this word. this means that we now
have 8 free bits in the mount flags. There are another two that might
well move over, but which I'm not sure about.
The only user visible change would have been in pstat -v, except
that davidg has disabled it anyhow.
I'd still like to move the state flags and the 'command' flags
apart from each other.. e.g. MNT_FORCE really doesn't have the
same semantics as MNT_RDONLY, but that's left for another day.
battery time. For backward compatibility with old binaries, I
assigned a new ioctl number for this call, and retained the old
one as APMIO_GETINFO_OLD. I also added eight words of padding and
a version field, so that future enhancements won't require jumping
through this hoop again.
actually offsets, they are offsets scaled by dividing by 2^cy_align.
I use different values for cy_align since the -current values are
unnaturally scaled, so I need different offsets, and the wrong
offsets got committed.
Reported by: nnd@itfs.nsk.su (N.Dudorov)
it in struct proc instead.
This fixes a boatload of compiler warning, and removes a lot of cruft
from the sources.
I have not removed the /*ARGSUSED*/, they will require some looking at.
libkvm, ps and other userland struct proc frobbing programs will need
recompiled.
2) Fix temporal decimation, disable it when
doing CAP_SINGLEs, and in dual-field capture, don't
capture fields for different frames
Submitted by: Luigi Rizzo & Randall Hopper
hope i've found out all files that actually depend on this dependancy.
IMHO, it's not very good practice to change the size of internal
structs depending on kernel options.
This corresponds to Voxware 3.5-alpha-<something> and Amancio's guspnp21.
There was a bit of a FUBAR during the commmit, so not all files are
mentioned in this commit's mail.
X-rant: I have just started to _*HATE*_ CVS...
changes:
o rip the old select from his distribution to prevent extra pollution
o the code now uses audio dma, helps reduce clicks
o improved card support, should work in full duplex on sb16 cards
o add better voxware ioctl support pointed out by Joao Carlos Mendes
Luis <jonny@coppe.ufrj.br>
o remove an unused file that I included for more complete history
o and MANY other changes
I have personally tested this code with a CS4237 based card and an AWE32
(non-PnP). Both cards worked fine in 8bit and 16bit mode.
This make the Miro PCTV work for me, including audio, and should
hopefully fix the other audio problems some people have been having.
Reviewed by: ahasty & Luigi Rizzo (freebsd-multimedia)
Very rudimentary, lots of error checks missing, but it works.
Dont do an ls on two different CD's though, it will eat your
changer mechanism for lunch :), this clearly needs some more
thought. Until then this will enable those with changers to
mount their multible CD's and doing "sensible" work....
Thanks to Andrew Gordon <arg@arg1.demon.co.uk> for donating a drive
(a NEC CDR-C251 4x4) that makes this possible to develop.
to define it by including <sys/kernel.h>. That broke PC-CARD
support for this driver, producing the dreaded "device allocation
failed" message. Surprisingly, the missing include caused only
two compiler warnings. The compilation still "succeeded" anyway.
Some of these changes are a bit rough and will become
more polished later. the changes to if_ethersubr should largely be moved
to within the appletalk code, but that will happen later.
A few of these were related to network-byteorder problems,
and more were related to loopback failures.
removed. Add a new state 'suspend' so we 'fake' insertion events at
resume time for the cards that have been suspended.
[
The code still works if you remove the card during suspend, switch the
card during suspend, or combinations of both.
]
Reviewed by: frf@xocolatl.com
in <machine/cpu.h>. Moved the declarations to <machine/cputypes.h>.
Fixed style bugs in the moved code. Fixed everything that depended on
the nested include. Don't include <machine/cpu.h> (in the changed files)
unless something in it is used directly.
and fixed everything that dependended on it being declared in the old
place. It is used in "machine-independent" code in subr_prof.c.
Moved declaration of btext from subr_prof.c to <machine/cpu.h>. It
is machine-dependent.
limit doesn't have anything to do with characters. The count mainly
needs to fit in the VOP_READ() ioflag after being left shifted by 16.
Moved vn_lock() before vn_closefile(). vn_lock() was mismerged from
Lite2.
Removed some gratuitous braces.
in a file. There was a (harmless, I think) off-by-1 error. This
was fixed in ufs long ago (rev.1.21 of ufs_readwrite.c) but not
in cd9660.
cd9660_read() has stagnated in many other ways. It is closer to
the Net/2 ufs_read() (which is was cloned from) than ufs_read()
itself is.
usage at 0x100. Quoted Justin's quotation from the manual as well, to
explain the technical background.
PR: kern/4559
Submitted by: Stephen J. Roznowski <sjr@home.net>
use a Linker Set. Note, if a driver is loaded as an LKM if will have
to use the function call, but since none of the existing drivers
are loadable, this made things cleaner and boot messages nicer.
Obtained from: PAO-970616
Rename vn_default_error to vop_defaultop all over the place.
Move vn_bwrite from vfs_bio.c to vfs_default.c and call it vop_stdbwrite.
Use vop_null instead of nullop.
Move vop_nopoll from vfs_subr.c to vfs_default.c
Move vop_sharedlock from vfs_subr.c to vfs_default.c
Move vop_nolock from vfs_subr.c to vfs_default.c
Move vop_nounlock from vfs_subr.c to vfs_default.c
Move vop_noislocked from vfs_subr.c to vfs_default.c
Use vop_ebadf instead of *_ebadf.
Add vop_defaultop for getpages on master vnode in MFS.
flicker won't occur when set_border() is called.
- Properly restore the border color when switching virtual consoles.
Pointed out by: tony@dell.com
OKed by: sos
screen size was changed while the screen saver was inactive. Adjust
the positions of the daemon and the text and clip them accordingly
each time.
- Don't call set_border() too often. Some video chip may produce
flicker.
Pointed out by tony@dell.com
- Don't fill the entire screen with blank char every time the saver is
called. Blank only the part of the screen where the daemon and the
text was previously printed.
* Kill individual drivers 'suspend' routines, since there's no simple/safe
way to suspend/resume a card w/out going through the complete probe
at initialization time.
* Default to using the apm_pccard_resume sysctl code, which basically
pretends the card was removed, and then re-inserted. Suspend/resume
is now 'emulated' with a fake insert/removal. (Hence we no longer
need the driver-specific suspend routines.)
follow.
* Rename/reorder all of the pccard structures, change many of the member
names to be descriptive, and follow more closely other 'bus' drivers
naming schemes.
* Rename a bunch of parameter and local variable names to be more
consistant in the code.
* Renamed the PCCARD 'crd' device to be the 'card' device
* KNF and make the code consistant where it was obvious.
* ifdef'd out some unused code
own definition of ISA_HOLE_START. We shouldn't need to include
bus/processor specific code in here, but it is required. At least by
doing it this way it becomes more obvious where the bogusness is.
Obtained from: email with bde
but it has too much baggage).
- create a new routine 'unregister_device_interrupt', which is now used
instead of having two routines with the same code snippet.
- Minor cleanups and commenting.
[ No functional changes, just moving things around ]