Commit Graph

589 Commits

Author SHA1 Message Date
joerg
685add8053 Casting to void is the canonical way of marking a variable as
potentially unused.
2014-02-20 00:29:03 +00:00
tsutsui
bb834b97ba Remove obsolete exec.c for a.out. It was superseded by loadfile() long ago. 2014-01-12 15:19:57 +00:00
jakllsch
d2ad8298ea Make libsa fsmod string pointer const. 2014-01-05 21:38:25 +00:00
jakllsch
cc6c3a11f9 intmax_t might be long long, handle accordingly. from christos 2013-12-24 22:26:21 +00:00
jakllsch
74f35cdadc Add 'j' format modifier for intmax_t. 2013-12-24 21:41:49 +00:00
jakllsch
a88e58194e Fix a use-after-free (well, dealloc actually) issue. 2013-11-27 17:33:03 +00:00
christos
02a4ce877b make a gcc unitialized variable 2013-11-03 00:44:34 +00:00
christos
ecffa9b765 XXX: gcc initializations 2013-10-20 17:17:30 +00:00
christos
892b86a26f remove unused 2013-10-20 17:16:57 +00:00
christos
683cfc6937 use new function to avoid array overflow 2013-10-20 17:15:42 +00:00
joerg
69d0b9d44c Let's not use uninitialized variables to write to random memory
locations, shall we?
2013-10-13 20:09:02 +00:00
pgoyette
5beb5eb050 Rework previous (1.24) change. Rather than depending on the
file's flags to decide if decompress cleanup is needed, just
check to see if the open() allocated the 'struct sd *' used for
decompression.

This fixes recent problem where presence of a "load=ffs" command
in my /boot.cfg resulted in a "heap full" error at boot time.

OK martin@
2013-10-11 16:30:31 +00:00
matt
f0f9ccc930 Use LIBISPRIVATE?= yes 2013-08-21 08:30:50 +00:00
dholland
e1610ba4cb Stick ffs_, ext2_, chfs_, filecore_, cd9660_, or mfs_ in front of
the following symbols so as to disambiguate fully. (Christos already
did the lfs ones.)

   lblkno
   lblktosize
   lfragtosize
   numfrags
   blkroundup
   fragroundup
2013-06-23 07:28:36 +00:00
dholland
2737439da3 fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB()

(Christos already did the lfs ones a few days back)
2013-06-23 02:06:04 +00:00
dholland
64912b9b11 blkoff() -> mfs_blkoff()
XXX: this shouldn't be using "mfs" for its symbols as we also have
XXX: sys/ufs/mfs.
2013-06-19 18:18:12 +00:00
dholland
f1333577b5 Rename ambiguous macros:
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE
   NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR
   INOPB -> FFS_INOPB, LFS_INOPB
   INOPF -> FFS_INOPF, LFS_INOPF
   blksize -> ffs_blksize, ext2_blksize, or lfs_blksize
   sblksize -> ffs_blksize

These are not the only ambiguously defined filesystem macros, of
course, there's a pile more. I may not have found all the ambiguous
definitions of blksize(), too, as there are a lot of other things
called 'blksize' in the system.
2013-06-19 17:51:25 +00:00
christos
855bb66ef7 Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.
2013-06-18 18:18:57 +00:00
dholland
5a420c1b9a Stick UFS_ in front of these symbols:
DIRBLKSIZ
   DIRECTSIZ
   DIRSIZ
   OLDDIRFMT
   NEWDIRFMT

Part of PR 47909.
2013-06-09 17:57:08 +00:00
dholland
89582ef58a Build properly against the lfs changes. 2013-06-09 00:02:33 +00:00
tsutsui
ab5da9a864 Wrap >80 char lines that overflowed on NDADDR -> EXT2FS_NDADDR changes. 2013-05-10 15:22:37 +00:00
martin
e7f80397d9 Make the check in close() for a non-deflatable file mode symetric to
the one in open().
Avoids dealloc() calls on NULL.
2013-04-14 22:23:28 +00:00
dholland
dcd34a91c5 Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
2013-01-22 09:39:11 +00:00
matt
e140e7a99f Pass down an empty CPUFLAGS since CPUFLAGS is contained in CFLAGS. 2012-12-12 15:12:11 +00:00
joerg
c14f2d4ef8 Deal with optional HAVE_GCC. 2012-08-10 16:05:26 +00:00
mhitch
ddc56403a8 Fix cd9660_read() to not read past the end of the file. This would result
in incorrect resid values, and causes the read of /boot.cfg to ignore the
file.  If the requested transfer extends past the end of the file, force
the internal buffer to be used, and when transferring data from the
internal buffer, limit the transfer to what's left in the file.  CDROM
boot will now process the /boot.cfg file.
2012-07-23 00:49:20 +00:00
dsl
6a03bb6b37 Remove the code that tries to load the "ffs" kernel module during boot.
This is in line with the core decision than even modular kernels should
  contain the ffs code.
I've left in the code that tries to load "nfs" and "ext2fs", but it
  isn't clear that is necessary.
Removes a warning message that (usually) flashes past to fast to read.
AFAICT all the relevant kernels contain ffs (and nfs for that matter).
2012-05-21 21:34:16 +00:00
tsutsui
1296da9587 Fix a bug that libsa ls doesn't work in case of filename with directory path.
("ls /path/and/file" always returns not found)  From MINIX via Evgeniy Ivanov.
2012-03-02 12:08:44 +00:00
christos
8ead40fd5d PR/45796: Evgeniy Ivanov minixfs3 support.
Split out fn_match since we have 3 copies now.
2012-01-16 18:44:13 +00:00
tsutsui
c2e8ce644b Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

 - add 'ls' op to struct fs_ops to support ls command on each fs,
   enabled by -DLIBSA_ENABLE_LS_OP and SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
   in libsa
 - split sys/lib/libsa/ufs_ls.c into UFS specific part and MI part (ls.c)
   that opens the target fs and calls fs-depedent XXX_ls() functions
 - add a ls op for ext2fs
   (all other fs than ufs and ext2fs don't have actual ls ops yet)
 - replace existing MD ufs_ls() calls with this new MI ls()

The original patch was written for i386 and ext2fs.
zaurus zboot has been tested by nonaka@.
ews4800mips and x68k loaders have been tested by me (with several fixes).
landisk might be okay since it was almost copied from i386.

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
      replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
2011-12-25 06:09:08 +00:00
jakllsch
a6deec34f7 Fix printf formating in ifdef DEBUG sections. 2011-07-30 03:43:20 +00:00
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
mrg
db6886e029 apply some -O0 with gcc 4.5 and vax. 2011-07-03 15:29:34 +00:00
mrg
e405cd7d86 remove HAVE_GCC == 4 conditional 2011-06-20 08:22:43 +00:00
joerg
df3149f5ef Don't use C versions of memcmp, memcpy, memmove, memset and strchr
on x86 for standalone code. The assembler versions are much smaller.
2011-06-16 16:47:53 +00:00
joerg
be964ea63f Add an optional MD calling convention flag for use in libsa when space
optimisation is critical. Use this on i386 to switch to register passing
calling convention for the file system entry points and most assembler
call backs that have to preserve at least 3 registers.
2011-06-16 13:44:56 +00:00
joerg
c97378d081 Add an optional MD calling convention flag for use in libsa when space
optimisation is critical. Use this on i386 to switch to register passing
calling convention for the file system entry points and most assembler
call backs that have to preserve at least 3 registers.
2011-06-16 13:27:58 +00:00
joerg
a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
tsutsui
f38f34147b KNF a bit. 2011-05-20 16:33:07 +00:00
nakayama
99c51b3804 Use %zd for ssize_t, and %zu for size_t. 2011-05-13 23:35:09 +00:00
zoltan
b3cd019cf9 Separate the IP and UDP code paths inside libsa, so I can add HTTP booting
later.
2011-05-11 16:23:40 +00:00
joerg
eb077f08e0 No trailing 0 byte for hexdigits. 2011-02-25 00:20:36 +00:00
joerg
36ed38c29f Move HEXDIGIT to mvme68k's sboot. It seems to be the only user.
Save a byte by explicitly specifying the size.
2011-02-25 00:17:35 +00:00
christos
392bc55180 revert bad whitespace change. 2011-02-17 21:15:31 +00:00
christos
abd082246f fix -Wself-assign warning 2011-02-17 19:38:48 +00:00
jakllsch
dc93c72587 Pacify Clang -Wformat-security. 2011-01-06 02:45:13 +00:00
jakllsch
71481e188f Zero the in-memory super block after allocation. It contains a pointer
that, if not properly initialized, could be improperly deallocated.
2011-01-02 21:37:01 +00:00
christos
e5c1816344 fix slightly wrong format. 2010-12-26 23:55:52 +00:00
he
b7a6da19d6 Print size_t and ssize_t with %zd, not just %d.
(How did this build before?)
2010-12-26 17:48:37 +00:00
jakllsch
fbe9cca8ce Correct recently exposed printf format problem. 2010-12-25 01:08:44 +00:00