Currently the whole buffer supplied by the client is traced.
AIX uses buffer sizes such as 64, 256, 1024 on properties that might
not exist or contain 1 or 8 bytes.
Limit the output to the amount of data actually written into the buffer.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@893 f158a5a8-5612-0410-a976-696ce0be7e32
test-method for "instantiate-rtas" would fail on the /rtas node.
According to CHRP 1.5 draft, the stack order seems reversed.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@891 f158a5a8-5612-0410-a976-696ce0be7e32
Don't trace the buffer length in place of the property size.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@889 f158a5a8-5612-0410-a976-696ce0be7e32
This patch allocates an extra 192 bytes of stack space required by unoptimised gcc builds for saving arguments to the stack. As
suggested by Igor previously (see http://lists.openbios.org/pipermail/openbios/2009-July/003762.html and SVN r508).
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@887 f158a5a8-5612-0410-a976-696ce0be7e32
As used by OpenSolaris. This enables OpenSolaris boot to proceed further by allowing the kernel to correctly manage its own TLB
misses.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@886 f158a5a8-5612-0410-a976-696ce0be7e32
New GCCs (for example 4.6.0) needed a few more functions to
libgcc. Without the functions, there were a lot of linker errors:
LINK openbios-qemu.elf
libqemu.a(ofmem.o): In function `hash_page':
/src/openbios-devel/obj-ppc/../arch/ppc/qemu/ofmem.c:353: undefined reference to `_restgpr_25_x'
libqemu.a(ofmem.o): In function `ea_to_phys':
/src/openbios-devel/obj-ppc/../arch/ppc/qemu/ofmem.c:231: undefined reference to `_restgpr_30_x'
etc.
Copy the needed functions from Linux.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@885 f158a5a8-5612-0410-a976-696ce0be7e32
Compiling PPC with GCC 4.6.0 20100925 produced a few warnings:
../fs/hfs/block.c: In function 'reuse':
../fs/hfs/block.c:304:11: error: variable 'chain' set but not used [-Werror=unused-but-set-variable]
../fs/iso9660/iso9660_mount.c: In function 'iso9660_name':
../fs/iso9660/iso9660_mount.c:18:16: error: variable 'uh' set but not used [-Werror=unused-but-set-variable]
Fix the warnings by avoiding write-only variables.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@884 f158a5a8-5612-0410-a976-696ce0be7e32
Compiling Sparc32 with GCC 4.6.0 20100925 produced a few warnings:
../arch/sparc32/context.c: In function 'start_main':
../arch/sparc32/context.c:49:9: error: variable 'retval' set but not used [-Werror=unused-but-set-variable]
../arch/sparc32/romvec.c: In function 'obp_devwrite':
../arch/sparc32/romvec.c:326:9: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
../drivers/iommu.c: In function 'iommu_init':
../drivers/iommu.c:102:24: error: variable 'vers' set but not used [-Werror=unused-but-set-variable]
../drivers/iommu.c:102:18: error: variable 'impl' set but not used [-Werror=unused-but-set-variable]
Fix the warnings by avoiding write-only variables.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@883 f158a5a8-5612-0410-a976-696ce0be7e32
Compiling Sparc64 with GCC 4.6.0 20100925 produced a few warnings:
../arch/sparc64/context.c: In function 'start_main':
../arch/sparc64/context.c:49:9: error: variable 'retval' set but not used [-Werror=unused-but-set-variable]
../packages/disk-label.c: In function 'dlabel_load':
../packages/disk-label.c:183:8: error: variable 'buf' set but not used [-Werror=unused-but-set-variable]
../drivers/floppy.c: In function 'collect_interrupt':
../drivers/floppy.c:378:13: error: variable 'status' set but not used [-Werror=unused-but-set-variable]
Fix the warnings by avoiding write-only variables.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@882 f158a5a8-5612-0410-a976-696ce0be7e32
A printk statement was commented out and there were format string mismatches for ppc target.
Use OFMEM_TRACE to more easily enable/disable it and use FMT_ucellx as in other trace output.
Note that this changes the alignment from decimal to hexidecimal notation.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@881 f158a5a8-5612-0410-a976-696ce0be7e32
The comparison would've always been false due to missing $.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@880 f158a5a8-5612-0410-a976-696ce0be7e32
Autodetect cross compilation, so cross- prefix is no longer needed.
Unify cross and native configurations.
Add unix- prefix to enable openbios-unix build for selected target,
similarly builtin- for builtin targets etc.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@879 f158a5a8-5612-0410-a976-696ce0be7e32
the va>tte-data defer.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@878 f158a5a8-5612-0410-a976-696ce0be7e32
Otherwise it chokes on ducell in include/kernel/stack.h.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@876 f158a5a8-5612-0410-a976-696ce0be7e32
than assembler.
In order to allow OpenSolaris to boot under OpenBIOS, it is necessary to be able to invoke Forth words from within the MMU
I/D-TLB miss handlers, since Solaris 10 kernels hook into the virtual to physical address translation process via va>tte-data at
boot time. Hence this patch implements two macros: SAVE_CPU_STATE and RESTORE_CPU_STATE which enable a context switch to occur
from within these trap handlers.
Things are more complicated from within the MMU miss handlers because we can't use flushw to flush the processor registers to
stack. This is because the memory pointed to by the stack pointer may not be in the TLB either, and so we'd end up in a
recursive MMU trap. Hence we solve this by creating a static stack within OpenBIOS which is guaranteed to be locked in the TLB
and storing all of our state there.
Once the ability to switch context has been implemented, it is possible to invoke C functions as per normal from within the MMU
miss handlers. Hence as a proof of concept I've migrated the MMU miss handling code from ASM to C with a view of making the
relevant changes to invoke the relevant Forth functions at a later date.
I'd also like to say thank you to Blue Swirl who took the time to answer all my questions and generally point out the
shortcomings in my first attempts at SPARC assembler.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@874 f158a5a8-5612-0410-a976-696ce0be7e32
The existing 8K stack used when switching context to run the executable payload was not enough. Increasing the stack to 16K
solves the issue, preventing the payload from clobbering memory within OpenBIOS as it runs.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@873 f158a5a8-5612-0410-a976-696ce0be7e32
Each console write caused temporary buffer allocation.
Avoid allocations by changing console_draw_str() to use Forth
string parameters, which are usually readily available.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@872 f158a5a8-5612-0410-a976-696ce0be7e32
Add checks to fill_rect() and video_scroll().
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@871 f158a5a8-5612-0410-a976-696ce0be7e32
The maximum allowed value for x axis is one less than cons.w.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@870 f158a5a8-5612-0410-a976-696ce0be7e32
is emitted by dump_service(). After successful execution the return value
and a linebreak are emitted by dump_return(). If however the method fails,
nothing is emitted, so that subsequent method calls end up in place of the
return value. Observed for getproplen with AIX.
Emit an error indication and a linebreak when DEBUG_CIF is defined.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@868 f158a5a8-5612-0410-a976-696ce0be7e32
Free the string returned by my_args_copy() also in error cases.
Adjust string parsing to avoid strdup() calls.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@866 f158a5a8-5612-0410-a976-696ce0be7e32
Make seek_name() compare the path component in a case-insensitive way.
Should fix an issue reported by Mark.
Cc: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@865 f158a5a8-5612-0410-a976-696ce0be7e32
There's a mixup of 0 and -1. Don't return failure if iso9660_open() succeeded. Don't return success in case
iso9660_open() or iso9660_mount() failed.
This resolves both a hang when trying to boot cd:,\\:tbxi and failure to boot either cd:,\ppc\bootinfo.txt
or cd:,\ppc\chrp\bootfile.exe despite present on the AIX 6.1 disk.
Cc: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@864 f158a5a8-5612-0410-a976-696ce0be7e32
DMA should be enabled before using it.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@862 f158a5a8-5612-0410-a976-696ce0be7e32
Move nested extern declarations into header files, or use the
already existing declarations.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@861 f158a5a8-5612-0410-a976-696ce0be7e32
OFmem is not available on x86.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@860 f158a5a8-5612-0410-a976-696ce0be7e32
Solaris 9 boot; i.e. remove the /CPU/mmu device, relocate its methods to /virtual-memory, and alter the /chosen mmu property so
that it now points to /virtual-memory. This helps both Solaris 9 and OpenSolaris boot further along the way.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@859 f158a5a8-5612-0410-a976-696ce0be7e32
Can't enable Sparc32 yet, there is no ofmem_claim().
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@858 f158a5a8-5612-0410-a976-696ce0be7e32
it existed when opening a disk device. Emulate this behaviour in order to fix Solaris 9 boot. With thanks to Tarl for pointing
me in the right direction.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@857 f158a5a8-5612-0410-a976-696ce0be7e32
and physical memory and setting up an MMU mapping.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@856 f158a5a8-5612-0410-a976-696ce0be7e32
Found with this Coccinelle script:
@@
type T;
identifier i;
expression E;
@@
(
extern T i;
|
- T i;
<+... when != i
- i = E;
...+>
)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@855 f158a5a8-5612-0410-a976-696ce0be7e32
to ensure that execution of any platform-specific boot code can occur before the main "load & go" boot, even if they invoke
Forth commands that alter the parse buffer.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@854 f158a5a8-5612-0410-a976-696ce0be7e32
The ePAPR spec requires us to have a /hypervisor node that tells the guest OS
which hypervisor it's running on and which hypercall to use to call into it.
So let's fetch all that information from Qemu's fw_cfg interface and put it
into place, making everyone happy.
Signed-off-by: Alexander Graf <agraf@suse.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@853 f158a5a8-5612-0410-a976-696ce0be7e32
callback as suggested by Google, and simply return nothing for the v2 callback as indicated by the romvec structure. This allows us to remove the
extra POP() which was causing a stack underflow error which was affecting Solaris 8 installation kernel boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@850 f158a5a8-5612-0410-a976-696ce0be7e32
If a loader succeeds, don't try the others.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@847 f158a5a8-5612-0410-a976-696ce0be7e32
If the size of the partition currently being probed is zero,
fail the probe. This lets Forth code try the next candidate from
boot-device list.
Add explicit ':d' (Sparc32, 'f' for Sparc64) partition to
CDROM probe list, so we can remove the ugly forced partition logic.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@846 f158a5a8-5612-0410-a976-696ce0be7e32
Move initial banner printing, CPU setup and graphic_depth
setup to openbios.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@845 f158a5a8-5612-0410-a976-696ce0be7e32