Commit Graph

33 Commits

Author SHA1 Message Date
Andreas Färber
380cd335cc Don't assume that pointer and cell size are identical, part 1
On ppc64, cell size is 32 bits but pointers are 64-bit.
Thus, direct casts result in warnings, treated as errors.

Use [u]intptr_t cast or cell2pointer and pointer2cell macros as necessary.

v2:
* Drop changes related to physical addresses since physical addresses may be
  wider than pointers (e.g., 36 bits on sparc32, as pointed out by Blue).
* Drop changes to cell2pointer() and pointer2cell() for now.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@922 f158a5a8-5612-0410-a976-696ce0be7e32
2010-10-25 20:48:45 +00:00
Blue Swirl
7d13c41dad Add checks for open_ih() return value
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@842 f158a5a8-5612-0410-a976-696ce0be7e32
2010-08-08 18:50:22 +00:00
Blue Swirl
482249e794 Use standard types
Replace uchar, uint, ulong, u_char, u_int, u_long, u_int* with
their standard equivalents.

Fixes warnings like these on OpenBSD:
 CC    target/arch/unix/unix.o
In file included from ../arch/unix/unix.c:29:
../include/config.h:26: warning: redefinition of `ulong'
/usr/include/sys/types.h:56: warning: `ulong' previously declared here
../include/config.h:26: warning: redundant redeclaration of `ulong' in same scope

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@830 f158a5a8-5612-0410-a976-696ce0be7e32
2010-08-01 21:25:08 +00:00
Mark Cave-Ayland
f1e745579c Switch dir over to use the new static filesystem dir methods.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@817 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-11 18:57:19 +00:00
Mark Cave-Ayland
a5511ad95c Currently the dir word works by using /packages/misc-files to open a directory in a similar way to a file and then
special-casing directory actions. This is wrong in that in order to list the contents of a directory, open-dev must return true 
for any device which contains a valid filesystem, regardless of whether or not the supplied arguments reference a valid path.

This causes us a problem because in order to implement multiple references in boot-device correctly, we have to fail if we open 
a specific device with invalid arguments (such as a non-existent file reference). This patch therefore makes the following changes:

1) Create a static method in each of the filesystem packages to implement dir
2) Enhance the partition/disk handlers to record the phandle of any detected filesystem during open
3) Create a new dir method in the partition/disk handlers which invokes the static dir method for the currently detected 
filesystem

Hence we can now open a raw device/partition and invoke dir on its filesystem without having to open a specific file-reference 
first. Following shortly is a patch to switch the main dir word over to use this new system.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@816 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-10 13:11:22 +00:00
Mark Cave-Ayland
930ce00f5f Move the grubfs filesystem handler into its own new package /packages/grubfs-files. This is the last of the filesystems to be
migrated to a standard package. Note that with this in place /packages/misc-files is obsolete (it is currently disabled) and 
very likely to be removed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@815 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-04 13:37:00 +00:00
cdrom - deblocker - disk-label - (misc-files | sun-parts | pc-parts | mac-parts)
7fc4e304c3 As documented on the mailing lists, change the interposition order of the disk packages from:
cdrom -> deblocker -> disk-label -> (misc-files | sun-parts | pc-parts | mac-parts) 

to:

cdrom -> deblocker -> disk-label -> (sun-parts | pc-parts | mac-parts) -> misc-files 

This makes the overall code much simpler, since instead of passing get-info structures between the different layers to work out 
the current device offset, each package can simply maintain its own offsets and bubble them back up to the parent.

There are also many, many bugfixes present is patch, some of which are given below:

- Add debugging in /packages/misc-files, augment debugging in all other disk packages
- Fix alignment issue in /packages/pc-parts so it works correctly on strictly align archs, e.g. SPARC64
- Fix parsing of [<id>,][filename] arguments to load (in preparation for next patch set)
- Fix byte-swapping issues in /packages/mac-parts (in theory it should now work regardless of endian)




git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@791 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-08 20:59:08 +00:00
Mark Cave-Ayland
00b2f978f8 Fix RR alignment bug in the grubfs iso9660 driver which prevented CD directory entries from being read correctly.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@777 f158a5a8-5612-0410-a976-696ce0be7e32
2010-05-24 20:55:21 +00:00
Mark Cave-Ayland
1dbe55b8e4 Move the basic OpenBIOS configuration header files from include/openbios to include/.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@695 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 17:19:58 +00:00
Mark Cave-Ayland
4a2c065e4f Move the libopenbios header files into include/libopenbios to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@691 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 15:05:53 +00:00
Mark Cave-Ayland
9a1c40734c Move the fs header file into include/fs to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@690 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 14:33:32 +00:00
Blue Swirl
a3e861a2cf Use -fno-strict-aliasing flag for all filesystems imported from GRUB.
Otherwise, they won't compile with gcc 4.4.  Fixing the code would
require massive changes, which is not practical for the code taken from
another project.

Author: Pavel Roskin <proski@gnu.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@569 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-23 12:40:24 +00:00
Laurent Vivier
6a16562087 This patch allows to boot from bootsector of first bootable partition
using "boot hd:%BOOT"

As explained in:

"PowerPC Microprocessor Common Hardware Reference Platform (CHRP)
System binding to:
IEEE Std 1275-1994 Standard for Boot (Initialization, Configuration)
Firmware
Revision: 1.8"

"Chapter 11.1.2. Open Method Algorith"

Signed-off-by: Laurent Vivier <Laurent@vivier.info>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@552 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-12 19:55:31 +00:00
Blue Swirl
a0c398f24b Delete some unused macros detected with -Wp,-Wunused-macros use
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@482 f158a5a8-5612-0410-a976-696ce0be7e32
2009-03-28 14:28:16 +00:00
Blue Swirl
a72df592da Fix endianess bug in Rock Ridge extensions
git-svn-id: svn://coreboot.org/openbios/openbios-devel@450 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-08 15:45:15 +00:00
Laurent Vivier
0b01355058 Reset curfs to &dummy_fs on mount (fs_grubfs_open())
git-svn-id: svn://coreboot.org/openbios/openbios-devel@446 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-05 21:21:59 +00:00
Aurelien Jarno
709c8c466a grubfs: don't try to read a file beyond its end
Yaboot relies on the read function from openbios to stop reading at the
end of a file. This patch makes sure to not read beyond the end of the
file. This fixes the boot of debian-installer using a CD-ROM.
    
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>


git-svn-id: svn://coreboot.org/openbios/openbios-devel@373 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-09 19:43:39 +00:00
Blue Swirl
a32f1855be Update FSF addresses
git-svn-id: svn://coreboot.org/openbios/openbios-devel@351 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-05 18:50:53 +00:00
Blue Swirl
51c8f0bf08 Change part_length to a define
git-svn-id: svn://coreboot.org/openbios/openbios-devel@311 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-23 10:14:48 +00:00
Blue Swirl
02c295c00c Fix ISO9660 endian problems, ignore case
git-svn-id: svn://coreboot.org/openbios/openbios-devel@306 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-22 16:01:12 +00:00
Laurent Vivier
cd90eca8ce remove useless printk
This patch removes useless printk()

Signed-off-by: Laurent Vivier <Laurent@lvivier.info>


git-svn-id: svn://coreboot.org/openbios/openbios-devel@300 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-20 20:23:55 +00:00
Blue Swirl
7e21fc929d Fix almost all remaining warnings
git-svn-id: svn://coreboot.org/openbios/openbios-devel@294 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-20 17:15:47 +00:00
Blue Swirl
c5d270009e Warning fixes for Sparc32, Sparc64, PPC
Fix warnings that would be caused by gcc flag -Wwrite-strings and
-Wmissing-prototypes. Also fix most PPC specific warnings.


git-svn-id: svn://coreboot.org/openbios/openbios-devel@288 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-14 12:54:23 +00:00
Blue Swirl
a757800a01 Remove unnecessary trailing newlines
git-svn-id: svn://coreboot.org/openbios/openbios-devel@285 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-13 09:26:41 +00:00
Blue Swirl
58ca864765 Delete extra whitespace at the end of line, which annoys quilt
git-svn-id: svn://coreboot.org/openbios/openbios-devel@284 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-11 20:30:53 +00:00
Blue Swirl
bf0c6b1c38 Fix most warnings from Sparse
git-svn-id: svn://coreboot.org/openbios/openbios-devel@274 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-30 11:54:01 +00:00
Blue Swirl
c52d26b976 Reduce warnings by 29%
git-svn-id: svn://coreboot.org/openbios/openbios-devel@273 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-29 19:31:28 +00:00
Blue Swirl
e5bc7e8990 Fix system include file use
git-svn-id: svn://coreboot.org/openbios/openbios-devel@250 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-17 19:42:11 +00:00
Stefan Reinauer
baaa1bb85c From Igor V. Kovalenko:
This openbios-grubfs-ext2fs-block.patch fixes a problem where inode
pointer is truncated to 32bit integer and then sign-extended to 64bit
integer while passing second pointer argument to ext2_rdfsb.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@230 f158a5a8-5612-0410-a976-696ce0be7e32
2008-08-24 12:54:03 +00:00
Stefan Reinauer
dfd35a78c0 Patch from Aurelien Jarno <aurelien@aurel32.net>:
The current SVN version currently fails to work on machines that have
strict alignment requirements, for example the SPARC target. This is due
to the way the struct fat_bpb in fs/grubfs/fat.h is defined and accessed
(through FAT_CVT_U16) to avoid padding. Some 16 bits fields like
bytes_per_sect are thus accessed unaligned.

The patch below takes the same approach as for other structures in
openbios, it declares the structure as packed, and lets GCC do the right
things to access those unaligned field.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@122 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-15 00:41:40 +00:00
Stefan Reinauer
2e863bf2ce some filesystem fixes (mostly remainder from blueswirl's -15)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@31 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-24 11:10:55 +00:00
Stefan Reinauer
1ab6b463ad latest sparc32 patch from Blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@13 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-07 16:40:13 +00:00
Stefan Reinauer
5c9eb9b45b initial import of openbios--main--1.0--patch-26
git-svn-id: svn://coreboot.org/openbios/openbios-devel@1 f158a5a8-5612-0410-a976-696ce0be7e32
2006-04-26 15:08:19 +00:00