Am 15.10.2010 um 00:17 schrieb Andreas Färber:
diff --git a/arch/ppc/qemu/rtas-tokens.c b/arch/ppc/qemu/rtas-tokens.c new file mode 100644 index 0000000..f251716 --- /dev/null +++ b/arch/ppc/qemu/rtas-tokens.c @@ -0,0 +1,63 @@ +/*
- Copyright (c) 2010 Andreas Färber andreas.faerber@web.de
- */
+#define RTAS_MAX_ARGS 10
+typedef struct rtas_args {
- unsigned long token;
- long nargs;
- long nret;
- unsigned long args[RTAS_MAX_ARGS];
+} rtas_args_t;
+void rtas_interface(rtas_args_t*, void*);
+/* drivers/escc.h */ +#define IO_ESCC_OFFSET 0x00013000 +/* drivers/escc.c */ +#define CTRL(addr) (*(volatile unsigned char *)(addr)) +#define DATA(addr) (*(volatile unsigned char *)(addr + 16)) +#define Tx_BUF_EMP 0x4 /* Tx Buffer empty */
+/*static void uart_putchar(int port, unsigned char c) +{
- while (!(CTRL(port) & Tx_BUF_EMP))
;
- DATA(port) = c;
+}*/
+/*void serial_putchar(char);*/
+static void serial_putchar(char c) +{
- unsigned long addr = 0x80800000;
- volatile unsigned char *serial_dev = (unsigned char *)addr +
IO_ESCC_OFFSET + 0x20;
- //uart_putchar((int)serial_dev, c);
- volatile unsigned char * port = serial_dev;
- while (!(CTRL(port) & Tx_BUF_EMP))
;
- DATA(port) = c;
+}
If I add a new method void dprintk(const char* s) here, I get this:
CC target/arch/ppc/qemu/rtas-tokens.o LINK rtas-qemu.bin target/arch/ppc/qemu/rtas-tokens.o: In function `rtas_interface': /Users/andreas/QEMU/OpenBIOS/openbios/obj-ppc/../arch/ppc/qemu/rtas- tokens.c:51: undefined reference to `_GLOBAL_OFFSET_TABLE_' make: *** [rtas-qemu.bin] Error 1
Any ideas? Isn't the GOT some ELF concept?
$ powerpc-elf-gcc -v Using built-in specs. COLLECT_GCC=powerpc-elf-gcc COLLECT_LTO_WRAPPER=/Users/andreas/QEMU/OpenBIOS/bin/libexec/gcc/ powerpc-elf/4.5.1/lto-wrapper Target: powerpc-elf Configured with: ../gcc-4.5.1/configure --prefix=/Users/andreas/QEMU/ OpenBIOS/bin --target=powerpc-elf --disable-nls --disable-threads -- enable-languages=c --disable-shared --disable-libssp --with-gmp=/Users/ andreas/QEMU/OpenBIOS/bin --with-mpfr=/Users/andreas/QEMU/OpenBIOS/bin Thread model: single gcc version 4.5.1 (GCC)
Andreas
+enum {
- DISPLAY_CHARACTER = 1,
+};
+void rtas_interface(rtas_args_t* params, void* privateData) +{
- switch (params->token) {
case DISPLAY_CHARACTER: {
serial_putchar((char)params->args[0]);
serial_putchar('x');
params->args[params->nargs] = 0;
break;
}
default:
serial_putchar('.');
params->args[params->nargs] = -1;
break;
- }
- serial_putchar('\r');
- serial_putchar('\n');
+}