freebsd-skq/sys/kern
Warner Losh 358fef538f Sometimes, when asked to return region A..C, we'd return A+N..C+N
instead of failing.

When looking for a region to allocate, we used to check to see if the
start address was < end.  In the case where A..B is allocated already,
and one wants to allocate A..C (B < C), then this test would
improperly fail (which means we'd examine that region as a possible
one), and we'd return the region B+1..C+(B-A+1) rather than NULL.
Since C+(B-A+1) is necessarily larger than C (end argument), this is
incorrect behavior for rman_reserve_resource_bound().

The fix is to exclude those regions where r->r_start + count - 1 > end
rather than r->r_start > end.  This bug has been in this code for a
very long time.  I believe that all other tests against end are
correctly done.

This is why sio0 generated a message about interrupts not being
enabled properly for the device.  When fdc had a bug that allocated
from 0x3f7 to 0x3fb, sio0 was then given 0x3fc-0x404 rather than the
0x3f8-0x3ff that it wanted.  Now when fdc has the same bug, sio0 fails
to allocate its ports, which is the proper behavior.  Since the probe
failed, we never saw the messed up resources reported.

I suspect that there are other places in the tree that have weird
looping or other odd work arounds to try to cope with the observed
weirdness this bug can introduce.  These workarounds should be located
and eliminated.

Minor debug write fix to match the above test done as well.

'nice' by: mdodd
Sponsored by: timing solutions (http://www.timing.com/)
2005-03-15 20:28:51 +00:00
..
bus_if.m
clock_if.m
cpufreq_if.m
device_if.m
genassym.sh
imgact_aout.c
imgact_elf32.c
imgact_elf64.c
imgact_elf.c
imgact_gzip.c
imgact_shell.c
inflate.c
init_main.c
init_sysent.c
kern_acct.c
kern_acl.c
kern_alq.c
kern_clock.c
kern_condvar.c
kern_conf.c Remove findcdev(). 2005-03-15 12:58:08 +00:00
kern_context.c
kern_cpu.c
kern_descrip.c Remove redundant initialization that is repeated in the for() loop 2005-03-08 16:57:20 +00:00
kern_environment.c My addled brains didn't realize that since vtp points into value, we 2005-03-09 12:16:45 +00:00
kern_event.c
kern_exec.c
kern_exit.c - A lock is required before calling VOP_REVOKE. Our reference protects us 2005-03-13 11:47:04 +00:00
kern_fork.c
kern_idle.c
kern_intr.c
kern_jail.c
kern_kse.c
kern_kthread.c
kern_ktr.c
kern_ktrace.c
kern_linker.c
kern_lock.c - transferlockers() requires the interlock to be SMP safe. 2005-03-15 09:27:45 +00:00
kern_lockf.c Fix a debug message to print a usable device name rather than useless 2005-03-15 14:08:10 +00:00
kern_mac.c
kern_malloc.c
kern_mbuf.c
kern_mib.c
kern_module.c
kern_mtxpool.c
kern_mutex.c
kern_ntptime.c
kern_physio.c
kern_poll.c
kern_proc.c Function jailed() looks into ucred strcture, so be sure ucred is not NULL. 2005-03-12 14:31:04 +00:00
kern_prot.c In linux emulation layer try to detect attempt to use linux_clone() to 2005-03-03 16:57:55 +00:00
kern_resource.c
kern_sema.c
kern_shutdown.c
kern_sig.c The td_waitset is pointing to a stack address when thread is waiting 2005-03-04 22:46:31 +00:00
kern_subr.c
kern_switch.c
kern_sx.c
kern_synch.c
kern_syscalls.c
kern_sysctl.c
kern_tc.c
kern_thr.c
kern_thread.c Allocate umtx_q from heap instead of stack, this avoids 2005-03-05 09:15:03 +00:00
kern_time.c
kern_timeout.c
kern_umtx.c Allocate umtx_q from heap instead of stack, this avoids 2005-03-05 09:15:03 +00:00
kern_uuid.c
kern_xxx.c
ksched.c
link_elf_obj.c
link_elf.c
linker_if.m
Make.tags.inc
Makefile
makesyscalls.sh
md4c.c
md5c.c
p1003_1b.c
posix4_mib.c
sched_4bsd.c
sched_ule.c
subr_acl_posix1e.c
subr_autoconf.c
subr_blist.c
subr_bus.c
subr_clist.c
subr_clock.c
subr_devstat.c
subr_disk.c
subr_eventhandler.c
subr_hints.c fix spelling of match in comment... 2005-03-10 21:23:06 +00:00
subr_kdb.c
subr_kobj.c
subr_log.c
subr_mbpool.c
subr_mchain.c
subr_module.c
subr_msgbuf.c
subr_param.c
subr_pcpu.c
subr_power.c
subr_prf.c
subr_prof.c
subr_rman.c Sometimes, when asked to return region A..C, we'd return A+N..C+N 2005-03-15 20:28:51 +00:00
subr_rtc.c
subr_sbuf.c
subr_scanf.c
subr_sleepqueue.c
subr_smp.c
subr_taskqueue.c
subr_trap.c
subr_turnstile.c
subr_unit.c Remove debugging printfs. 2005-03-14 06:51:29 +00:00
subr_witness.c Document, via WITNESS, that the NFS server mutex falls ahead of the socket 2005-03-09 21:38:53 +00:00
sys_generic.c
sys_pipe.c
sys_process.c
sys_socket.c The SO_NOSIGPIPE socket option allows a user process to mark a socket 2005-03-11 15:06:16 +00:00
syscalls.c
syscalls.master Fix typo in comment. 2005-03-09 11:50:55 +00:00
sysv_ipc.c
sysv_msg.c
sysv_sem.c
sysv_shm.c
tty_compat.c
tty_conf.c
tty_cons.c
tty_pty.c
tty_subr.c
tty_tty.c
tty.c Replace my previous change for 32 bit systems with hz > 169 with Bruce's 2005-03-12 00:13:45 +00:00
uipc_accf.c Move the logic implementing retrieval of the SO_ACCEPTFILTER socket option 2005-03-12 12:57:18 +00:00
uipc_cow.c
uipc_domain.c
uipc_mbuf2.c
uipc_mbuf.c allow the destination of m_move_pkthdr to have external 2005-03-08 17:52:01 +00:00
uipc_proto.c
uipc_sem.c
uipc_sockbuf.c Extend the coverage of the accept and socket mutexes in soisconnected() 2005-03-12 13:39:39 +00:00
uipc_socket2.c Extend the coverage of the accept and socket mutexes in soisconnected() 2005-03-12 13:39:39 +00:00
uipc_socket.c Move the logic implementing retrieval of the SO_ACCEPTFILTER socket option 2005-03-12 12:57:18 +00:00
uipc_syscalls.c Add kernel-only flag MSG_NOSIGNAL to be used in emulation layers to surpress 2005-03-08 16:11:41 +00:00
uipc_usrreq.c
vfs_acl.c
vfs_aio.c
vfs_bio.c - Lock access to the buffer_map with the vm_map lock. In 4.x this was 2005-03-08 09:34:54 +00:00
vfs_cache.c
vfs_cluster.c
vfs_default.c - Don't drop the lock in the default inactive handler anymore, VOP_NULL 2005-03-13 11:45:01 +00:00
vfs_export.c
vfs_extattr.c - Don't VOP_UNLOCK prior to VOP_REVOKE. The lock is required now. 2005-03-13 11:45:51 +00:00
vfs_hash.c Improve the vfs_hash() API: vput() the unneeded vnode centrally to 2005-03-15 20:00:03 +00:00
vfs_init.c
vfs_lookup.c
vfs_mount.c
vfs_subr.c - Now that there are no external users of vfree() make it static. 2005-03-15 14:38:16 +00:00
vfs_syscalls.c - Don't VOP_UNLOCK prior to VOP_REVOKE. The lock is required now. 2005-03-13 11:45:51 +00:00
vfs_vnops.c - Do a vn_start_write in vn_close, we may write if this is the last ref 2005-03-13 11:56:28 +00:00
vnode_if.src - CLOSE, REVOKE, INACTIVE, and RECLAIM are not L L L, that's a locked vnode 2005-03-13 11:42:16 +00:00