j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: mcayland Date: Sun Dec 9 21:37:53 2012 New Revision: 1078 URL: http://tracker.coreboot.org/trac/openbios/changeset/1078
Log: PPC: Implement filll (fill long) word for QEMU/PPC as required by BootX.
Based upon an original patch by John Arbuckle programmingkidx@gmail.com.
Signed-off-by: John Arbuckle programmingkidx@gmail.com Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/init.c Fri Dec 7 15:28:07 2012 (r1077) +++ trunk/openbios-devel/arch/ppc/qemu/init.c Sun Dec 9 21:37:53 2012 (r1078) @@ -613,6 +613,21 @@ fword("finish-device"); }
+/* + * filll ( addr len quad -- ) + */ + +static void ffilll(void) +{ + const u32 longval = POP(); + u32 len = POP(); + u32 *aaddr = (u32 *)cell2pointer(POP()); + + while (len--) { + *aaddr++ = longval; + } +} + void arch_of_init(void) { @@ -877,6 +892,9 @@
device_end();
+ /* Implementation of filll word (required by BootX) */ + bind_func("filll", ffilll); + bind_func("platform-boot", boot); bind_func("(go)", go); }
+/*
- filll ( addr len quad -- )
- */
+static void ffilll(void) +{
- const u32 longval = POP();
- u32 len = POP();
- u32 *aaddr = (u32 *)cell2pointer(POP());
- while (len--) {
*aaddr++ = longval;
- }
+}
This is wrong: the "len" parameter is a length _in bytes_. If it's not a multiple of four, Apple's implementation writes one to three bytes too many.
Segher
On 09/01/13 22:30, Segher Boessenkool wrote:
+/*
- filll ( addr len quad -- )
- */
+static void ffilll(void) +{
- const u32 longval = POP();
- u32 len = POP();
- u32 *aaddr = (u32 *)cell2pointer(POP());
- while (len--) {
- *aaddr++ = longval;
- }
+}
This is wrong: the "len" parameter is a length _in bytes_. If it's not a multiple of four, Apple's implementation writes one to three bytes too many.
Okay :( Patch to fix this to follow shortly.
ATB,
Mark.