History log of /freebsd-9.3-release/lib/libstand/stand.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 223905 10-Jul-2011 avatar

- Removing some unneeded definitions of NULL(cruft related to 1970's C).
In C90, NULL is guaranteed to be declared in <stddef.h> and also in
<string.h>. Though the correct way to define NULL in FreeBSD is to
include <sys/_null.h>, other parts of libstand still require <string.h>
to build; therefore, we keep <string.h> in stand.h and add a note about
this;
- Removing no longer used 'Prototype' definition. Quote from bde@:

'Cruft related to getting incomplete struct declarations within
prototypes forward-declared before the structs. It doesn't mean
"prototype" but only part of a prototype-related hack. No longer
used.'

- Replacing iaddr_t with uintptr_t;
- Removing use of long double to determine alignment. Use a fixed 16 byte
alignment instead;

Reviewed by: bde
Obtained from: DragonFlyBSD (partially)
MFC after: 1 month


# 192679 24-May-2009 dfr

Increase the number of available file descriptors to 64. This fixes the
reported zfsboot problems for systems where more than seven drives are part
of ZFS pools.


# 184732 06-Nov-2008 raj

Eliminate dead declarations in libstand.


# 182748 04-Sep-2008 raj

Eliminate __alpha__ leftover from libstand.


# 165906 08-Jan-2007 imp

Remove California Regent's clause 3, per letter


# 146327 17-May-2005 obrien

Don't use a patch w/in /usr/src. Programmatically change files when needed.


# 135576 22-Sep-2004 stefanf

Prefer C99's __func__ over GCC's __FUNCTION__.


# 124570 15-Jan-2004 jhb

- Print out line number in a panic message using %d rather than %p. Line
numbers aren't pointers.
- Add a __printflike() attribute to libstand's panic() prototype to catch
such bogons in the future.


# 121532 26-Oct-2003 peter

Preserve the constness of the value argument passed to env_setenv() as
it gets passed through the filter functions.


# 108100 19-Dec-2002 jake

Renamed the loader's zipfs to gzipfs. zipfs.c was repo-copied to gzipfs.c.


# 102227 21-Aug-2002 mike

o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
macros, which are only MD because of gratuitous differences between
architectures.
o Change all headers to make use of this. This mainly involves
changing:
#ifdef _BSD_FOO_T_
typedef _BSD_FOO_T_ foo_t;
#undef _BSD_FOO_T_
#endif
to:
#ifndef _FOO_T_DECLARED
typedef __foo_t foo_t;
#define _FOO_T_DECLARED
#endif

Concept by: bde
Reviewed by: jake, obrien


# 102216 21-Aug-2002 scottl

Fix a typo in #if 0 code


# 100394 20-Jul-2002 peter

Reimplement malloc/free debugging that includes the offending file:line
info. This turned out to be rather useful on ia64 for tracking down
malloc/free problems.
Detect duplicate free()'s - otherwise these show up as a guard1 failure
and it looks like corruption instead of something simple like a second
free() where there shouldn't be.
Deal with libz using libc headers and not seeing the malloc/free stuff that
we provide in libstand. Do similar nastiness to what is done for bzlib.

Tested on: i386, ia64 (compile, run)


# 100392 20-Jul-2002 peter

Add __printflike() to printf() and sprintf() prototypes. -ffreestanding
turns off gcc's builtin attributes for these functions and as a result
-Wformat does no checking. (argh)


# 97776 03-Jun-2002 sobomax

Correct bswap64() prototype.

Submitted by: glewis
MFC after: 1 day
(assuming that there is re's approval)


# 92495 17-Mar-2002 sobomax

(forced)

Splitfs is subject of:

MFC after: 2 weeks


# 92494 17-Mar-2002 sobomax

Add splitfs vfs layer into libstand, which allows loading big kernels and
modules split across several physical medias. Following is how it works:

The splitfs code, when asked to open "foo" looks for a file "foo.split"
which is a text file containing a list of filenames and media names, e.g.

foo.aa "Kernel floppy 1"
foo.ab "Kernel floppy 2"
foo.ac "Kernel and modules floppy"

For each file segment, the process is:

- try to open the file
- prompt "Insert the disk labelled <whatever> and press any key..."
- try to open the file
- return error if file could not be located

RE team is free to use this feature in the upcoming 5.0-DP1.

Reviewed by: msmith, dcs


# 91959 09-Mar-2002 mike

o Don't require long long support in bswap64() functions.
o In i386's <machine/endian.h>, macros have some advantages over
inlines, so change some inlines to macros.
o In i386's <machine/endian.h>, ungarbage collect word_swap_int()
(previously __uint16_swap_uint32), it has some uses on i386's with
PDP endianness.

Submitted by: bde

o Move a comment up in <machine/endian.h> that was accidentially moved
down a few revisions ago.
o Reenable userland's use of optimized inline-asm versions of
byteorder(3) functions.
o Fix ordering of prototypes vs. redefinition of byteorder(3)
functions, so that the non-GCC (libc asm) case has proper
prototypes.
o Add proper prototypes for byteorder(3) functions in <sys/param.h>.
o Prevent redundant duplicate prototypes by making use of the
_BYTEORDER_PROTOTYPED define.
o Move the bswap16(), bswap32(), bswap64() C functions into MD space
for platforms in which asm versions don't exist. This significantly
reduces the complexity of some things at the cost of duplicate code.

Reviewed by: bde


# 90868 18-Feb-2002 mike

o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
complexities associated with having MD (asm and inline) versions, and
having to prevent exposure of these functions in other headers that
happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on: alpha, i386
Reviewed by: bde, jake, tmm


# 87632 10-Dec-2001 jhb

We support writing to at least one filesystem now.

PR: kern/32389
Submitted by: Jonathan Mini <mini@haikugeek.com>
Sponsored by: ClickArray, Inc.


# 83610 18-Sep-2001 sobomax

Add support for loading bzip2-compressed filesystems. Among other things
this would allow to load bzip2-compressed kernels/modules from the loader(8)
(support for that will be committer separately).

MFC after: 1 month


# 76579 14-May-2001 dcs

Replace functional bugs of ctypish functions in libstand with style
bugs.

reviewed by: bde
MFC after: 1 week


# 76136 29-Apr-2001 msmith

Unbreak world by defining isalnum() for libstand consumers.


# 65921 16-Sep-2000 phk

Turn dkcksum() into an __inline function.

Change its type to u_int_16_t.


# 65470 05-Sep-2000 msmith

Implement readahead buffering for non-raw files. This drastically improves
the efficiency of byte-by-byte read operations on filesystems not already
supported by the block cache (especially NFS).

This should be a welcome change for users booting via PXE, as the loader
now reads its startup files almost instantly, instead of taking tens of
seconds.


# 64185 03-Aug-2000 jhb

Cleanup warnings by adding missint prototypes, removing unneeded duplicate
prototypes, and adding in several 'const's. Also, add some missing
$FreeBSD$'s.

Found by: BDECFLAGS


# 59766 29-Apr-2000 jlemon

Add a readdir function to the loader fsops vector, and implement the
functionality for some of the filesystesms.


# 59408 19-Apr-2000 ps

Add a cleanup function. This is needed for PXE where you should
shutdown the UNDI and unload the stack.


# 55206 29-Dec-1999 peter

Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot). This is consistant with the other
BSD's who made this change quite some time ago. More commits to come.


# 55181 28-Dec-1999 peter

Use the ctype.h version of isascii() - it doesn't loose precision and think
that 0x100 (int) is an ascii character.

Submitted by: bde


# 55137 27-Dec-1999 peter

Tidy up some loose ends. nullfs_read/write were returning the wrong value.
Fix some ctype problems - isascii() caused a warning if fed an unsigned
char - it's always > 0 and libstand is compiled with -Wall.
Missing prototype/include in printf.c


# 51169 11-Sep-1999 dfr

Change toupper/tolower so that they don't give a bogus answer if the
argument is already upper/lower.


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 42511 11-Jan-1999 msmith

POSIX introduced optreset to deal with multiple invocations
of getopt (as in, multiple input lines :). This is documented in the
man page and is used in the code, but unistd.h and stand.h do not
declare it. Incidentally, it prevents me fixing a bug in loader's
code... :-)

PR: misc/9373
Submitted by: "Daniel C. Sobral" <dcs@newsguy.com>


# 40891 04-Nov-1998 msmith

Well I never. Seems like _setjmp()/_longjmp() are just what the doctor
ordered. This brings the Alpha back to parity, and should bring us
BootForth on both platforms.

Submitted by: John Birrell (jb@freebsd.org)


# 40889 04-Nov-1998 msmith

Improve the quality of isspace() to match expectations. This should make
the Ficl interpreter read its softwords array OK.


# 40805 01-Nov-1998 msmith

Add:
assert()
setjmp()/longjmp()
vsprintf()


# 40774 31-Oct-1998 msmith

Add a new field to the devsw structure; dv_print, to print all valid units
etc. associated with the device entry.
Consider EOF an 'error' for fgetstr if we haven't read anything yet.

You *MUST* recompile and reinstall libstand before rebuilding the bootstrap.


# 40520 19-Oct-1998 dfr

Implement a hook to allow us to reclaim the memory used by the first stage
of the bootstrap (the bit which loads /boot/loader).


# 40005 06-Oct-1998 msmith

Enable the DOS filesystem. This allows reading from various DOS filesystems
(FAT12/16/32, VFAT).

Make a private copy of strcasecmp, as the "real" one uses the system ctype
header, which introduces locale poisoning.


# 39672 26-Sep-1998 dfr

* Enable old UFS compatibility code for booting from Digital Unix formatted
disks.
* Fix a whole raft of warnings, printf and otherwise.
* Make zalloc work for alpha (just a case of using the right typedef).
* Add some (disabled) malloc debug printing to stand.h.


# 39665 25-Sep-1998 msmith

Replace the old and extremely icky Mach/NetBSD allocator with a similarly
compact and much better one donated by Matt Dillon. Implement a simple
sbrk() which uses the existing setheap() api.

Remove the custom allocator from the UFS code. It wasn't working quite
right, and it shouldn't be needed with the new allocator.

Fix a serious problem with changing the value of already-existent
environment variables. Don't attempt to modify the supposedly-const
argument to putenv()

Fix an off-by-one sizing error in the zipfs code detected by the new
allocator.

Submitted by: zmalloc from Matt Dillon <dillon@backplane.com>


# 39469 18-Sep-1998 msmith

Nuke prototype for strerror, consumers get it from <string.h>
Fix overlooked nullopen() implementation.


# 39468 18-Sep-1998 msmith

Path arguments to *_open functions should be const, but we were mangling
them.

Submitted by: write-protected text segment in BTX


# 38506 24-Aug-1998 bde

Fixed syntax errors (__dead should have gone away years ago, and
__attribute__(()) is a gccism - we use __dead2).


# 38452 20-Aug-1998 msmith

This commit was generated by cvs2svn to compensate for changes in r38451,
which included commits to RCS files with non-trunk default branches.


# 38451 20-Aug-1998 msmith

This is libstand; a support library for standalone executables (eg. bootstrap
modules).
Obtained from: NetBSD, with some architectural changes and many additions.