bde [Sun, 14 Jun 1998 16:04:20 +0000 (16:04 +0000)]
Complete the switch to using gcc-2.4 features to declare fpos_t ,
as threatened in the 4-5 year old comment. Most of the change is
in <machine/ansi.h>; this commit just removes cruft for the strict
ANSI case. 64-bit types couldn't actually be defined using
__attribute__(()) in gcc-2.4, since attribute names in the
implementation namespace only became available in gcc-2.7. I've
probably just broken gcc-2.6 support by using the gcc-2.7 names
unconditionally.
bde [Sun, 14 Jun 1998 15:52:00 +0000 (15:52 +0000)]
Avoid an egcs pessimization for 64-bit signed division on i386's.
Pre-2.8 versions of gcc generate a call to __divdi3() for all 64-bit
signed divisions, but egcs optimizes them to a shift and fixup when
the divisor is a constant power of 2. Unfortunately, it generates
a call to __cmpdi2() for the fixup, although all except possibly
ancient versions of gcc and egcs do ordinary 64-bit comparisons
inline.
bde [Sun, 14 Jun 1998 14:08:21 +0000 (14:08 +0000)]
Define 64-bit types in terms of __int64_t and __uint64_t.
Define an unsigned version of off_t (uoff_t) if KERNEL is defined.
This is useful for micro-optimizing expressions involving off_t's
where you know that the values are non-negative but the compiler
doesn't know it.
bde [Sun, 14 Jun 1998 14:00:47 +0000 (14:00 +0000)]
Added typedefs for __int64_t and __uint64_t. These will be used to avoid
explicit use of `[unsigned] long long' and `[u]quad_t'.
Fixed disorder of and lack of comments for the types added in the previous
two commits. Improved some comments. The comments should be elswhere
(not duplicated in every MD file).
dfr [Sun, 14 Jun 1998 13:53:12 +0000 (13:53 +0000)]
[Add missing files from previous commit]
Major changes to the generic device framework for FreeBSD/alpha:
* Eliminate bus_t and make it possible for all devices to have
attached children.
* Support dynamically extendable interfaces for drivers to replace
both the function pointers in driver_t and bus_ops_t (which has been
removed entirely. Two system defined interfaces have been defined,
'device' which is mandatory for all devices and 'bus' which is
recommended for all devices which support attached children.
* In addition, the alpha port defines two simple interfaces 'clock'
for attaching various real time clocks to the system and 'mcclock'
for the many different variations of mc146818 clocks which can be
attached to different alpha platforms. This eliminates two more
function pointer tables in favour of the generic method dispatch
system provided by the device framework.
Future device interfaces may include:
* cdev and bdev interfaces for devfs to use in replacement for specfs
and the fixed interfaces bdevsw and cdevsw.
* scsi interface to replace struct scsi_adapter (not sure how this
works in CAM but I imagine there is something similar there).
* various tailored interfaces for different bus types such as pci,
isa, pccard etc.
dfr [Sun, 14 Jun 1998 13:46:10 +0000 (13:46 +0000)]
Major changes to the generic device framework for FreeBSD/alpha:
* Eliminate bus_t and make it possible for all devices to have
attached children.
* Support dynamically extendable interfaces for drivers to replace
both the function pointers in driver_t and bus_ops_t (which has been
removed entirely. Two system defined interfaces have been defined,
'device' which is mandatory for all devices and 'bus' which is
recommended for all devices which support attached children.
* In addition, the alpha port defines two simple interfaces 'clock'
for attaching various real time clocks to the system and 'mcclock'
for the many different variations of mc146818 clocks which can be
attached to different alpha platforms. This eliminates two more
function pointer tables in favour of the generic method dispatch
system provided by the device framework.
Future device interfaces may include:
* cdev and bdev interfaces for devfs to use in replacement for specfs
and the fixed interfaces bdevsw and cdevsw.
* scsi interface to replace struct scsi_adapter (not sure how this
works in CAM but I imagine there is something similar there).
* various tailored interfaces for different bus types such as pci,
isa, pccard etc.
bde [Sun, 14 Jun 1998 13:40:01 +0000 (13:40 +0000)]
Don't define away __attribute__() for the non-gcc and old-gcc cases.
Using __attribute__() in non-ifdefed code is just wrong if it changes
the semantics, and there is no way to ignore __attribute__() only in
the benign cases.
Don't use __attribute__ in non-ifdefed code here. It was a benign
case, but we already have a macro (__unused) for this case.
Expanded comment about gotchas for __CONCAT() in the non-ANSI case.
bde [Sun, 14 Jun 1998 12:53:39 +0000 (12:53 +0000)]
Avoid a 64-bit division in procfs_readdir(). Fixed related overflows.
Check args using the same expression as in fdesc and kernfs. The check
was actually already correct, modulo overflow. It could be tightened
up to either allow huge (aligned) offsets, treating them as EOF, or
disallow all offsets beyond EOF.
Didn't fix invalid address calculation &foo[i] where i may be out of
bounds.
Didn't fix shooting of foot using a private unportable dirent struct.
peter [Sun, 14 Jun 1998 11:25:46 +0000 (11:25 +0000)]
Don't compile in the use of poll() when building libc_r. This isn't
so much a "fix", rather a bandaid to buy time to fix it properly
within the thread engine.
brian [Sun, 14 Jun 1998 01:21:24 +0000 (01:21 +0000)]
Deal with PROTO_IGMP and PROTO_IPIP packets correctly.
Submitted by: Mark Tinguely <tinguely@plains.NoDak.edu>
This change will allow a PPP host enabled with the "-alias" option to
run mrouted. This does not intend to forward the IGMP nor tunneled packets
to another host on the far side if the tun0 interface.
brian [Sun, 14 Jun 1998 00:56:13 +0000 (00:56 +0000)]
o Pass our negotiated number of VJ slots into
sl_uncompress_tcp() and drop packets with
slot numbers that are out of range.
o Drop packets that want to use a slot that still
has an IP header length of 0 (ie, the requested
slot number is bogus again).
Without this code, if the other side mis-behaves (and
sends us garbage slot numbers), we happily ``adjust''
a memset(..., '\0', ...) TCP/IP header and promptly
cr*p all over the stack before returning.... quickly
followed by a SIGBUS.
Dodgy ISP used by, and help locating the problem from: jmz
Problem also seen by: Mourad de Riche <omnibus@image.dk>
There's still a link lockup after this happens, but my
bets are on the other side (who has already started sending
rubbish) being to blame.
peter [Sat, 13 Jun 1998 17:20:03 +0000 (17:20 +0000)]
Merge changes from vendor branch;
- connector selection values (should fix aui/bnc),
- non-shifting version of crc calculation using a table,
- interrupt mask adjustments,
- add some brackets where a #ifdef could break an if(),
- don't reset the card unless it's up.
peter [Sat, 13 Jun 1998 11:55:57 +0000 (11:55 +0000)]
Make -V expand it's arguments. This means that instead of 'make -V OBJS'
printing something useless (to a shell) like: ${SRCS:N*.h:R:S/$/.o/g}
it will instead print the actual ${OBJS} value.
julian [Sat, 13 Jun 1998 02:27:10 +0000 (02:27 +0000)]
Allow a protocol to specify that it does NOT want to be looped back
even if it looks like it should (backwards compatibility with
old broken code) should get rid of some annoying messags.
peter [Sat, 13 Jun 1998 02:03:36 +0000 (02:03 +0000)]
join(1) is used by lorder, add it to build-tools. (otherwise, things get
ugly when an a.out /usr/bin/join sees the elf LD_LIBRARY_PATH from a
'make world' and it's a.out ld.so tries to load the elf libc.so.)
julian [Fri, 12 Jun 1998 20:48:30 +0000 (20:48 +0000)]
Fix the case when renaming to a file that you've just created and deleted,
that had an inode that has not yet been written to disk, when the inode of the
new file is also not yet written to disk, and your old directory entry is not
yet on disk but you need to remove it and the new name exists in memory
but has been deleted but the transaction to write the deleted name to disk
exists and has not yet been cancelled by the request to delete the non
existant name. I don't know how kirk could have missed such a glaring
problem for so long. :-) Especially since the inconsitency survived on
the disk for a whole 4 second on average before being fixed by other code.
This was not a crashing bug but just led to filesystem inconsitencies
if you crashed.
brian [Fri, 12 Jun 1998 17:45:10 +0000 (17:45 +0000)]
o Maintain a link-type mask for open datalinks as well as
for all datalinks in a bundle. Ppp now deals correctly
with link types that are changed while open
o When changing the type of the last AUTO link, only clear
the interface if we're not in PHASE_NETWORK. This allows
us to switch to -ddial mode while we have a connection
without suddenly unexpectedly throttling ourselves by
clearing the interface configuration.
Problem area noted by: Aaron Jeremias Luz <aaron@csh.rit.edu>
peter [Fri, 12 Jun 1998 10:52:52 +0000 (10:52 +0000)]
Move bsd.own.mk after make.conf, this allows BINFORMAT to be set in
/etc/make.conf - it changes LIBDIR in bsd.own.mk. Note that there are
still problems with this, individual Makefiles cannot override BINFORMAT.
peter [Fri, 12 Jun 1998 10:43:18 +0000 (10:43 +0000)]
Force -DFREEBSD_AOUT incase ldconfig is being compiled under elf.
Without this, <link.h> defines stuff for elf linking which is not
what ldconfig needs.
julian [Fri, 12 Jun 1998 03:48:19 +0000 (03:48 +0000)]
Go through the loopback code with a broom..
Remove lots'o'hacks.
looutput is now static.
Other callers who want to use loopback to allow shortcutting
should call the special entrypoint for this, if_simloop(), which is
specifically designed for this purpose. Using looutput for this purpose
was problematic, particularly with bpf and trying to keep track
of whether one should be using the charateristics of the loopback interface
or the interface (e.g. if_ethersubr.c) that was requesting the loopback.
There was a whole class of errors due to this mis-use each of which had
hacks to cover them up.
jb [Fri, 12 Jun 1998 02:21:27 +0000 (02:21 +0000)]
Add poll to the list of hidden syscalls so that it gets renamed. This
propagates a bug (that there is no poll wrapper in libc_r), but it
prevents GNU configure scripts from trying to use it in preference
to select. libc_r really needs to change it's wait interface to use
poll instead of select because poll is more a superset of select that
the other way around.
This should allow the Roxen web server to work out-of-the-box. It's
configuration intercae is kinda neat. The code isn't. Shiver. 8-)
jb [Fri, 12 Jun 1998 02:17:18 +0000 (02:17 +0000)]
Update the caller's descriptor masks even if there are none ready for
I/O for those applications that don't believe the return value of zero as
meaning that THERE ARE *NO* DESCRIPTORS READY.
julian [Fri, 12 Jun 1998 01:54:29 +0000 (01:54 +0000)]
Allow diverted packets from the transmit side to remember if they
had a recv interface and allow that state to be available
after re-injection for further tests.
peter [Thu, 11 Jun 1998 14:40:42 +0000 (14:40 +0000)]
Zap the T_UID,T_GID and T_UINFO stuff, it doesn't exist in the bind8
headers. As I understand it, it was for some really ancient athena stuff
that has long been replaced.
peter [Thu, 11 Jun 1998 09:06:54 +0000 (09:06 +0000)]
Remove components that would duplicate those in libc now that the
includes and interfaces have been merged with the 8.1.2 update.
This essentially leaves the isc/* files that named and named-xfer use.
It might be best to just compile them with .PATH in both cases rather than
bothering with libbind.
peter [Thu, 11 Jun 1998 08:55:17 +0000 (08:55 +0000)]
Update nameserver interface to bind-8.1.2 levels. We do not use IRS (yet?)
since it has far wider impact than hostname lookups (including passwords).
Note that this has more ugly symbol hiding and binary compatability hacks
that can go away the second we bump majors.
Obtained from: Mostly from diff against ISC bind-8.1.2 sources
jb [Thu, 11 Jun 1998 03:53:23 +0000 (03:53 +0000)]
Remove -Werror from CFLAGS on i386 because with -nostdinc gcc spits
warnings from unused static inline functions in headers if you happen
to set CFLAGS without -O.
jb [Wed, 10 Jun 1998 22:28:45 +0000 (22:28 +0000)]
Check the access mode in the flags before waiting on a read or a write
that might never be possible if the file was not opened in the corrent
mode. This prevents a hang for bad programs. Why do people code like that?
jb [Wed, 10 Jun 1998 22:24:12 +0000 (22:24 +0000)]
When doing a F_SETFL, read the flags back so that the ones stored
in the file descriptor table are exactly what the kernel knows subject
to the O_NONBLOCK flag being requested by the user.