Commit Graph

999 Commits

Author SHA1 Message Date
he bd42895755 Use the %zu format for size_t printing instead of cast + %lu. 2003-09-04 11:42:52 +00:00
he 022f01cef7 Cast size_t to u_long before printing, and use %lu instead of %d as format.
Fixes compilation on alpha.
2003-09-03 12:43:41 +00:00
dsl fafabf93cc Another attempt to get libsa to contain the right things.
- put a 'standards conforming' memcmp into memcmp.c
- make bcmp be a second label on the same code
- make bcmp.c be just #include "memcmp.c"
This means that libsa.o might contain both a memcmp.o and a bcmp.o, but
both contain the same code (defining both symbols) so it doesn't matter
which ld uses.
Saves worrying about which of bcmp.c and memcmp.c the architecture specific
Makefile requests.
2003-09-01 12:28:03 +00:00
fvdl 60ae17c7ae Fix signed/unsigned warnings. 2003-08-31 22:40:13 +00:00
chs 6e0aaa640d update for LWPs, and some lite cleanup. 2003-08-31 01:52:43 +00:00
dsl 22588a3d36 The __strong_alias() seems to have to be in the file with the definition.
So make bcmp.c define bcmp and memcmp.
This should (?) fix the atari build.
(I've now no idea why the previous change defined memcpy for the alpha build.)
2003-08-29 19:53:18 +00:00
dsl 904ed3bb04 An ever sneakier way of making memcmp and bcmp use the same code:
__strong_alias(memcmp,bcmp)
2003-08-27 22:53:18 +00:00
dsl d0db314661 Use memset not bzero to help shrink alpha bootxx_lfs
(sys/arch/alpha/stand/common/start.S also uses bzero, I don't know
any alpha opcodes so cant change that one...)
2003-08-27 22:42:08 +00:00
matt 4a33fdce54 Actually the right instruction to fill a half-word.
From Juergen Hannken-Illjes hannken at eis dot cs dot tu-bs dot de
2003-08-27 17:37:43 +00:00
dsl db4706faf9 Reduce memory footprint:
- use file buffer for all block reads
- only save a small amount of the indirect block list
Allows i386 bootxx_ufs code to load /boot from a filesystem with 32k blocks
while still fitting inside 64k of memory.
Code size reduced as well (by ~1k on i386).
It ought to be possible to use a buffer that is smaller than a filesystem
block.  This might be needed in order to boot from filesystems with larger
block sizes.
2003-08-22 21:33:52 +00:00
elric 72e3ec4b0c Should call ufs_close() if it isn't being built in. 2003-08-21 00:01:28 +00:00
elric 2a56d40c5c make 'path' argument to cd9660_open 'const char *' and fix the fallout. 2003-08-21 00:00:52 +00:00
itojun 1403d9d920 KNF 2003-08-20 13:32:33 +00:00
ragge a9e5513c6b Kerner library files for pdp10. 2003-08-19 10:59:26 +00:00
dsl 8453fb0040 make 'path' argument to ufs_open 'const char *' and fix the fallout. 2003-08-18 15:45:27 +00:00
dsl d678060c05 KNF, fix a comment or two 2003-08-18 08:00:52 +00:00
ragge bc830a1980 Do not use the builtins for the mem* functions on vax, the compiler gets
confused with the static inline functions vax uses.
2003-08-13 11:34:24 +00:00
ragge f69577d50c Include the C versions of the string instructions.
Replace blkcpy() with a version that can handle overlapping data areas.
2003-08-13 11:32:23 +00:00
matt f70606090a Add a memset.S (does not use dcbz; to be added later). It does both bzero
and memset.
2003-08-10 21:17:08 +00:00
martin 785cae7ed0 Sync with userland version. 2003-08-10 14:20:03 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
scw 5d91e08442 In lookup(), don't free "dir" on exit if we found a matching entry.
Otherwise the caller ends up with a pointer to free'd memory...
2003-07-15 13:27:07 +00:00
dsl f92748a3e8 Add xlat_mbr_fstype - converts mbr type to disklabel type 2003-07-07 13:20:17 +00:00
martin 34718fb25a Protect opt_*.h include by _KERNEL_OPT 2003-06-23 14:17:24 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
briggs b2566d8735 Provide a strtoul() implementation based on the one in libc instead of the
totally different version that was here.  This version, of course, has an
BSD license on it while the old one did not.  This one also compiles down
to tighter code--the smaller the better for libkern & libsa.
2003-06-07 02:52:33 +00:00
itojun da3884cbf4 latest copyright notice (more loose). noted by wiz 2003-05-15 15:02:52 +00:00
itojun 99c5869d56 add strl{cpy,cat} to libkern. code from lib/libc/string (originally from openbsd). 2003-05-15 13:50:35 +00:00
scw 3722390978 Allow the default location of "machine/loadfile_machdep.h" to be
overridden if MACHINE_LOADFILE_MACHDEP is defined.
This makes life much simpler in the face of the myriad of
different boot options for the evb* ports.
2003-04-29 13:03:55 +00:00
tron e71f089777 Remove two unused variable to fix a build problem. 2003-04-27 11:12:14 +00:00
bjh21 01f90db242 Remove %b support.
Encouraged by thorpej.
2003-04-26 13:25:47 +00:00
christos abfff333c3 don't define TRUE and FALSE locally. 2003-04-22 15:10:04 +00:00
bjh21 2456c80578 If the format string ends with "%" or "%l", print those characters, just
as we would if they were part of an invalid conversion specification.
Code-size neutral on ARM; not tested elsewhere.
2003-04-20 22:23:59 +00:00
bjh21 94c13ff2cd ANSIfy, assume __STDC__, un-__P, KNF.
Generated code unchanged.
2003-04-20 19:31:29 +00:00
dsl 35632a80ac lfs code is built from ufs.c 2003-04-16 19:52:58 +00:00
dsl c327a133c6 Significantly faster memcpy/memmove/bcopy and memset/bzero 2003-04-15 22:49:50 +00:00
dsl 7c8e4cdaea Add interface to boot password checking code that takes password parameter. 2003-04-15 22:26:42 +00:00
dsl 4efa73a16e Build ffsv1 and ffsv2 2003-04-11 11:31:44 +00:00
dsl ef32565239 Add externs for ffsv1_xxx and ffsv2_xxx 2003-04-11 11:30:12 +00:00
dsl f671893500 Files to build ffsv1 and ffsv2 versions of ufs.c 2003-04-11 11:28:54 +00:00
dsl af3660bcdb Use common ffs/lfs file ufs.c instead of lfs specific version. 2003-04-11 11:27:06 +00:00
dsl 5a0534abeb Merge in lfs.c, use defines to build ffsv1, ffsv2, lfsv1 or lfsv2.
(removes the ability to build a single ufs.o that supports ffs v1 and v2,
that animal was too large for some of the boot code.)
Use shifts and masks to avoid pulling in 64bit divide.
2003-04-11 11:24:49 +00:00
dsl fbf4bd0cfe Put extern definition of bcopy in () to avoid macro expansion when
LIBSA_USE_MEMCPY is defined. Fixes breakage because the return
type of memcpy() is different to that of bcopy.
2003-04-11 10:34:38 +00:00
dsl cff85b34d5 Fix prototypes of null_read and null_write, change to return errno values.
This code can't actually be used anywhere!  I don't think its obvious use
would compile!
2003-04-10 14:44:05 +00:00
dsl 4a16b1cc1d Add FS_DEF() and FS_OPS() defines to save typing (and errors) elsewhere.
Kill __P() and argument names in prototypes.
(approved by christos)
2003-04-10 14:39:46 +00:00
scw bfc4be13a6 When MEMCOPY is defined, don't bother checking if a backwards-copy is
required. That's what memmove() is for.

This should fix port-powerpc/16889. The backwards copyin can confuse
uiomove/genfs_getpages, resulting in corruption of files written over NFS.
2003-04-07 21:04:19 +00:00
bjh21 f34ba16c9c NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__. 2003-04-05 23:27:14 +00:00
he 97b6d5bf4f Conditionalize declaration of local variable ``i'', now that the
code which uses it is also conditionalized.
2003-04-02 19:47:25 +00:00
fvdl 42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
mycroft 0b87bcb397 constify a couple of pointers. 2003-04-01 21:09:32 +00:00
thorpej 7a3fa51b7f Garbage-collect the DYNAMIC_CRC_TABLE stuff. The table it computed
was incompatible with the new CRC code, and it is largely unnecessary
now, since the static table is so much smaller.

Fixes PR kern/20935.
2003-03-29 22:25:25 +00:00
drochner 8b0843a5b2 There is no point in initializing "rootpath" to "/".
Move it into BSS.
2003-03-27 12:28:58 +00:00
mycroft d8c7d22134 *** empty log message *** 2003-03-25 22:52:48 +00:00
mycroft 8320edced9 Remove a whole bunch of crap -- including the entirely adler32 stuff that's
only used in gzip headers/footers -- that's not actually used here.  Also use
a smaller CRC table.  Saves >4k of code in boot images.
2003-03-25 22:48:43 +00:00
mycroft c6052ec21f const! const! 2003-03-25 22:35:36 +00:00
drochner f81c1c504b remove stuff just moved to bootparam.c and some variables which are
never used.
2003-03-19 17:19:32 +00:00
drochner 3906113e15 Move global variables which are used only by bootparam here.
("domainname" is useless and could be removed, but adding code to
skip this in the RPC reply would probably be more expensive than leaving
it as a dummy variable.)
2003-03-19 17:18:07 +00:00
mycroft 4d7fb7469d Finish const poisoning. 2003-03-18 20:00:47 +00:00
mycroft bb478ade6c Move more stuff into .rodata. 2003-03-18 19:33:51 +00:00
mycroft f6258762e1 Move some stuff into .rodata. 2003-03-18 19:20:09 +00:00
drochner 68edf0e576 separate ether_sprintf() from the rest of ethernet support -- sometimes
it makes sense to use the former w/o the latter (eg PXE)
2003-03-12 16:46:31 +00:00
drochner 7b3b2ea783 no need to include "netif.h" anymore
(shared interface stuff is in iodesc.h, included by net.h)
2003-03-12 14:51:31 +00:00
drochner 7816074c59 separate the netif interface from the rest of the networking code,
so that it can be replaced easily in md code
2003-03-12 14:49:19 +00:00
jmmv 5649a49e43 After the "insert disk <number>, and press return..." message, check only
for the return keypress.
2003-03-11 19:43:04 +00:00
drochner dd688f888f translate EACCES (happens with NFS) 2003-03-11 15:02:54 +00:00
dsl ef50700873 LIBSA_NO_CLOSE is LIBSA_NO_FS_CLOSE everywhere else. 2003-03-07 00:46:37 +00:00
matt cc005c66db Switch back to generic bzero/memset until new one is shown to work. 2003-02-25 20:15:02 +00:00
ragge e8d062d58b Remove bogus check for bogus netmask. 2003-02-25 14:42:30 +00:00
pk d71686ab26 Introduce fdloadfile() to load an image from an open file descriptor;
implement loadfile() in terms of it.

This allows clients to open a file once and "load" it multiple times (e.g.
first with COUNT_KERNEL, then with LOAD_KERNEL) without the side-effects
of multiple open calls.
2003-02-24 10:51:05 +00:00
matt 97d38cdec2 Actually use bzero.S. Also fix bzero to use GET_CPUINFO 2003-02-24 07:14:17 +00:00
matt 05a4c83a70 Don't make memset.c since bzero.o has memset in addition to bzero. 2003-02-24 07:09:18 +00:00
simonb 6e4342ca79 Add support for LFSv2 filesystems. From a libsa standpoint, LFSv1 and
LFSv2 are treated as separate filesystem types for size considerations.
2003-02-23 23:17:42 +00:00
simonb 7d43baad24 Use the MAX() macro from <sys/param.h> instead of a local inline. Results
in same code size in ufs.c and removes an unused inline function in lfs.c.
2003-02-23 22:47:43 +00:00
simonb 8d6004faf3 We can't use <string.h> for standalone programs;
use <lib/libkern/libkern.h> for str*() prototypes instead.
2003-02-23 12:31:29 +00:00
dsl 2d1837c8fc KNR, removing ugly 'unsigned' variables.
Probably should be size_t, but now matched prototype.
(mainly agreed with christos - he wanted size_t....)
2003-02-01 14:57:02 +00:00
dsl 912fab6ec9 Beautify a little 2003-02-01 14:54:22 +00:00
dsl 2c4edf02a4 Save some space
(agreed by christos)
2003-02-01 14:53:38 +00:00
dsl 3080e19ff3 Support limited filename globbing
- agreed by christos
2003-02-01 14:52:13 +00:00
fvdl a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
christos 8453828bf1 PR/19607: Bernd Ernesti: libsa does not have access to arpa/tftp.h. Put a
copy of it in our tftp.h
2003-01-12 18:59:15 +00:00
veego a64314e402 Fix broken build due too the move of the cd9660 and msdosfs kernel source code. 2002-12-30 16:41:53 +00:00
pk bd20047a69 Only display the final progress counter if any of the LOAD_ flags was given.
Fix comment describing the return value.
2002-12-11 09:55:20 +00:00
thorpej e8cc3884de Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is. 2002-12-10 17:14:02 +00:00
thorpej 4245ee1663 Wrap this file in "#ifndef _STANDALONE". 2002-12-05 17:12:06 +00:00
fvdl 144469b350 Add strtoul.c 2002-11-25 00:55:22 +00:00
fvdl a186add0a8 If LIBKERN_ARCH is defined, use that as the architecture-specific
subdirectory. Needed for the x86_64 32bit compile case.
2002-11-23 23:35:50 +00:00
chris f86ab1a63e Sync arm asm libkern files with libc's asm files. 2002-11-23 14:29:29 +00:00
itohy 6e73936f81 Use assembly version of bzero() and memset(). 2002-11-20 09:52:53 +00:00
itohy 5d1c87f395 Assembly version of bzero()/memset().
Written by SHIMIZU Ryo.
2002-11-20 09:51:52 +00:00
itohy 766d863c42 memcpy() and memmove() must return the first parameter.
Problem found by itohy, fixed by SHIMIZU Ryo.
2002-11-20 09:50:37 +00:00
rearnsha 6576c49b48 Add an assembler version of strcmp, based on example code from the ARM
ARM.  As an example of the performance difference that this provides
a Dhrystone score on my Shark goes from 213k to 261k.
2002-11-16 18:27:40 +00:00
thorpej 7f74df5ef3 ABICALLS -> __ABICALLS__ 2002-11-10 18:10:25 +00:00
perry efd79c70c9 Add lint infrastructure 2002-11-02 07:48:17 +00:00
perry 6448ffbdfe set LLIBS= so we don't try to check the lint lib against llib-lc.ln 2002-11-02 07:46:42 +00:00
chs cab484e445 move includes to the top so that this builds in libc context too. 2002-10-29 04:40:55 +00:00
chs c04f87a03e remove setjmp/longjmp from libkern, they're not used. 2002-10-27 18:45:11 +00:00
chs c5a350ef59 use %g5 instead of %g7 (since we want to use %g7 for the cpu_info pointer
in the kernel).  resync libc and libkern versions of this file.
2002-10-27 18:41:27 +00:00
christos 07dca24022 make offsetof lint friendlier. 2002-10-24 20:53:50 +00:00
scw 03c573236d Replace the SuperH memcpy() with homebrewed code. The former seems to have
a subtle failure mode which can result in corruption of memory outside the
bounds of the destination buffer.
2002-10-22 12:25:18 +00:00
scw ac76a83a5c Sync with libc/quad:
As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
2002-10-20 10:17:14 +00:00