summaryrefslogtreecommitdiff
path: root/examples/standalone
diff options
context:
space:
mode:
Diffstat (limited to 'examples/standalone')
-rw-r--r--examples/standalone/82559_eeprom.c2
-rw-r--r--examples/standalone/Makefile10
-rw-r--r--examples/standalone/atmel_df_pow2.c2
-rw-r--r--examples/standalone/eepro100_eeprom.c2
-rw-r--r--examples/standalone/hello_world.c2
-rw-r--r--examples/standalone/interrupt.c2
-rw-r--r--examples/standalone/mem_to_mem_idma2intr.c4
-rw-r--r--examples/standalone/smc91111_eeprom.c2
-rw-r--r--examples/standalone/smc911x_eeprom.c2
-rw-r--r--examples/standalone/stubs.c25
-rw-r--r--examples/standalone/test_burst.c2
-rw-r--r--examples/standalone/timer.c2
12 files changed, 25 insertions, 32 deletions
diff --git a/examples/standalone/82559_eeprom.c b/examples/standalone/82559_eeprom.c
index 5e2eee9..8dd7079 100644
--- a/examples/standalone/82559_eeprom.c
+++ b/examples/standalone/82559_eeprom.c
@@ -305,7 +305,7 @@ write_config_word(int bus, int dev, int func, int reg, u16 data)
}
-int main (int argc, char *argv[])
+int main (int argc, char * const argv[])
{
unsigned char *eth_addr;
uchar buf[6];
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 6ea3b93..5f1f800 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -72,6 +72,16 @@ gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
CPPFLAGS += -I..
+# For PowerPC there's no need to compile standalone applications as a
+# relocatable executable. The relocation data is not needed, and
+# also causes the entry point of the standalone application to be
+# inconsistent.
+ifeq ($(ARCH),powerpc)
+AFLAGS := $(filter-out $(RELFLAGS),$(AFLAGS))
+CFLAGS := $(filter-out $(RELFLAGS),$(CFLAGS))
+CPPFLAGS := $(filter-out $(RELFLAGS),$(CPPFLAGS))
+endif
+
all: $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF)
#########################################################################
diff --git a/examples/standalone/atmel_df_pow2.c b/examples/standalone/atmel_df_pow2.c
index db0cd69..b5b4503 100644
--- a/examples/standalone/atmel_df_pow2.c
+++ b/examples/standalone/atmel_df_pow2.c
@@ -114,7 +114,7 @@ static char *getline(void)
}
}
-int atmel_df_pow2(int argc, char *argv[])
+int atmel_df_pow2(int argc, char * const argv[])
{
/* Print the ABI version */
app_startup(argv);
diff --git a/examples/standalone/eepro100_eeprom.c b/examples/standalone/eepro100_eeprom.c
index 771a7e8..3c7f380 100644
--- a/examples/standalone/eepro100_eeprom.c
+++ b/examples/standalone/eepro100_eeprom.c
@@ -25,7 +25,7 @@
static int reset_eeprom(unsigned long ioaddr, unsigned char *hwaddr);
-int eepro100_eeprom(int argc, char *argv[])
+int eepro100_eeprom(int argc, char * const argv[])
{
int ret = 0;
diff --git a/examples/standalone/hello_world.c b/examples/standalone/hello_world.c
index 9317f6d..067c390 100644
--- a/examples/standalone/hello_world.c
+++ b/examples/standalone/hello_world.c
@@ -24,7 +24,7 @@
#include <common.h>
#include <exports.h>
-int hello_world (int argc, char *argv[])
+int hello_world (int argc, char * const argv[])
{
int i;
diff --git a/examples/standalone/interrupt.c b/examples/standalone/interrupt.c
index f3061d1..a5b58a1 100644
--- a/examples/standalone/interrupt.c
+++ b/examples/standalone/interrupt.c
@@ -44,7 +44,7 @@
static void irq_handler (void *arg);
-int interrupt (int argc, char *argv[])
+int interrupt (int argc, char * const argv[])
{
int c, irq = -1;
diff --git a/examples/standalone/mem_to_mem_idma2intr.c b/examples/standalone/mem_to_mem_idma2intr.c
index f35f1ba..d0a75ea 100644
--- a/examples/standalone/mem_to_mem_idma2intr.c
+++ b/examples/standalone/mem_to_mem_idma2intr.c
@@ -204,9 +204,9 @@ int memcmp(const void * cs,const void * ct,size_t count)
#endif /* STANDALONE */
#ifdef STANDALONE
-int mem_to_mem_idma2intr (int argc, char *argv[])
+int mem_to_mem_idma2intr (int argc, char * const argv[])
#else
-int do_idma (bd_t * bd, int argc, char *argv[])
+int do_idma (bd_t * bd, int argc, char * const argv[])
#endif /* STANDALONE */
{
int i;
diff --git a/examples/standalone/smc91111_eeprom.c b/examples/standalone/smc91111_eeprom.c
index b91f34c..c98b0fc 100644
--- a/examples/standalone/smc91111_eeprom.c
+++ b/examples/standalone/smc91111_eeprom.c
@@ -48,7 +48,7 @@ void print_MAC (struct eth_device *dev);
int read_eeprom_reg (struct eth_device *dev, int reg);
void print_macaddr (struct eth_device *dev);
-int smc91111_eeprom (int argc, char *argv[])
+int smc91111_eeprom (int argc, char * const argv[])
{
int c, i, j, done, line, reg, value, start, what;
char input[50];
diff --git a/examples/standalone/smc911x_eeprom.c b/examples/standalone/smc911x_eeprom.c
index 104047f..c51a050 100644
--- a/examples/standalone/smc911x_eeprom.c
+++ b/examples/standalone/smc911x_eeprom.c
@@ -313,7 +313,7 @@ static char *getline(void)
/**
* smc911x_eeprom - our application's main() function
*/
-int smc911x_eeprom(int argc, char *argv[])
+int smc911x_eeprom(int argc, char * const argv[])
{
/* Avoid initializing on stack as gcc likes to call memset() */
struct eth_device dev;
diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index ce3371d..2d2e709 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -65,26 +65,9 @@ gd_t *global_data;
" lw $25, %1($25)\n" \
" jr $25\n" \
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "t9");
-#elif defined(CONFIG_NIOS)
-/*
- * %g7 holds the pointer to the global_data. %g0 is call clobbered.
- */
-#define EXPORT_FUNC(x) \
- asm volatile ( \
-" .globl " #x "\n" \
-#x ":\n" \
-" pfx %%hi(%0)\n" \
-" movi %%g0, %%lo(%0)\n" \
-" add %%g0, %%g7\n" \
-" ld %%g0, [%%g0]\n" \
-" pfx %1\n" \
-" ld %%g0, [%%g0]\n" \
-" jmp %%g0\n" \
-" nop \n" \
- : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x) : "r0");
#elif defined(CONFIG_NIOS2)
/*
- * r15 holds the pointer to the global_data, r8 is call-clobbered
+ * gp holds the pointer to the global_data, r8 is call-clobbered
*/
#define EXPORT_FUNC(x) \
asm volatile ( \
@@ -92,11 +75,11 @@ gd_t *global_data;
#x ":\n" \
" movhi r8, %%hi(%0)\n" \
" ori r8, r0, %%lo(%0)\n" \
-" add r8, r8, r15\n" \
+" add r8, r8, gp\n" \
" ldw r8, 0(r8)\n" \
" ldw r8, %1(r8)\n" \
" jmp r8\n" \
- : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r15");
+ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "gp");
#elif defined(CONFIG_M68K)
/*
* d7 holds the pointer to the global_data, a0 is a call-clobbered
@@ -206,7 +189,7 @@ void __attribute__((unused)) dummy(void)
extern unsigned long __bss_start, _end;
-void app_startup(char **argv)
+void app_startup(char * const *argv)
{
unsigned char * cp = (unsigned char *) &__bss_start;
diff --git a/examples/standalone/test_burst.c b/examples/standalone/test_burst.c
index 7109c09..2b101b7 100644
--- a/examples/standalone/test_burst.c
+++ b/examples/standalone/test_burst.c
@@ -85,7 +85,7 @@ static unsigned long test_pattern [] = {
};
-int test_burst (int argc, char *argv[])
+int test_burst (int argc, char * const argv[])
{
unsigned long size = CACHE_LINE_SIZE;
unsigned int pass = 0;
diff --git a/examples/standalone/timer.c b/examples/standalone/timer.c
index 6628b21..834cc9a 100644
--- a/examples/standalone/timer.c
+++ b/examples/standalone/timer.c
@@ -115,7 +115,7 @@ void setPeriod (tid_8xx_cpmtimer_t *hwp, ulong interval);
static char *usage = "\n[q, b, e, ?] ";
-int timer (int argc, char *argv[])
+int timer (int argc, char * const argv[])
{
cpmtimer8xx_t *cpmtimerp; /* Pointer to the CPM Timer structure */
tid_8xx_cpmtimer_t hw;