summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2011-04-20 13:12:42 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2011-04-20 13:12:42 (GMT)
commita9697885d7d80894c454cfbe69adbcba1088c84b (patch)
tree22b8e456f48efe50b595f03ddcd5809e77981ca5
parente6641efc1c9443f1698d1f1e3770cbf5de67dcb9 (diff)
downloadopenipcam-a9697885d7d80894c454cfbe69adbcba1088c84b.zip
openipcam-a9697885d7d80894c454cfbe69adbcba1088c84b.tar.gz
openipcam-a9697885d7d80894c454cfbe69adbcba1088c84b.tar.bz2
gcc_3.3.4 support
-rw-r--r--uClinux-2.4.20-uc1/arch/armnommu/Makefile6
-rw-r--r--uClinux-2.4.20-uc1/arch/armnommu/kernel/compat.c68
-rw-r--r--uClinux-2.4.20-uc1/arch/armnommu/kernel/process.c28
-rw-r--r--uClinux-2.4.20-uc1/arch/armnommu/kernel/semaphore.c144
-rw-r--r--uClinux-2.4.20-uc1/arch/armnommu/kernel/setup.c161
-rw-r--r--uClinux-2.4.20-uc1/arch/armnommu/vmlinux-armv.lds.in5
-rw-r--r--uClinux-2.4.20-uc1/include/asm-armnommu/checksum.h67
-rw-r--r--uClinux-2.4.20-uc1/include/asm-armnommu/setup.h3
8 files changed, 230 insertions, 252 deletions
diff --git a/uClinux-2.4.20-uc1/arch/armnommu/Makefile b/uClinux-2.4.20-uc1/arch/armnommu/Makefile
index 92a7757..355e57e 100644
--- a/uClinux-2.4.20-uc1/arch/armnommu/Makefile
+++ b/uClinux-2.4.20-uc1/arch/armnommu/Makefile
@@ -62,8 +62,10 @@ LINKFLAGS += -EB
LDFLAGS += -EB
endif
-CFLAGS += $(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes
-AFLAGS += $(apcs-y) $(proc-y) -mno-fpu
+load-y := $(call check_gcc,-mshort-load-bytes,-malignment-traps)
+
+CFLAGS += $(apcs-y) $(arch-y) $(tune-y) $(load-y)
+AFLAGS += $(apcs-y) $(proc-y)
LIBGCC := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name)
diff --git a/uClinux-2.4.20-uc1/arch/armnommu/kernel/compat.c b/uClinux-2.4.20-uc1/arch/armnommu/kernel/compat.c
index a23932c..23c085d 100644
--- a/uClinux-2.4.20-uc1/arch/armnommu/kernel/compat.c
+++ b/uClinux-2.4.20-uc1/arch/armnommu/kernel/compat.c
@@ -8,7 +8,7 @@
* published by the Free Software Foundation.
*
* We keep the old params compatibility cruft in one place (here)
- * so we don't end up with lots of
+ * so we don't end up with lots of mess around other places.
*/
#include <linux/config.h>
#include <linux/types.h>
@@ -33,18 +33,18 @@ static struct tag * __init memtag(struct tag *tag, unsigned long start, unsigned
return tag;
}
-static void __init build_tag_list(struct param_struct *params, void *taglist, int mem_init)
+static void __init build_tag_list(struct param_struct *params, void *taglist)
{
struct tag *tag = taglist;
- printk(KERN_DEBUG "Converting old-style param struct to taglist\n");
-
if (params->u1.s.page_size != PAGE_SIZE) {
printk(KERN_WARNING "Warning: bad configuration page, "
"trying to continue\n");
return;
}
+ printk(KERN_DEBUG "Converting old-style param struct to taglist\n");
+
tag->hdr.tag = ATAG_CORE;
tag->hdr.size = tag_size(tag_core);
tag->u.core.flags = params->u1.s.flags & FLAG_READONLY;
@@ -76,35 +76,33 @@ static void __init build_tag_list(struct param_struct *params, void *taglist, in
tag->hdr.size = tag_size(tag_revision);
tag->u.revision.rev = params->u1.s.system_rev;
- if (mem_init) {
#ifdef CONFIG_ARCH_ACORN
- if (machine_is_riscpc()) {
- int i;
- for (i = 0; i < 4; i++)
- tag = memtag(tag, PHYS_OFFSET + (i << 26),
- params->u1.s.pages_in_bank[i] * PAGE_SIZE);
- } else
+ if (machine_is_riscpc()) {
+ int i;
+ for (i = 0; i < 4; i++)
+ tag = memtag(tag, PHYS_OFFSET + (i << 26),
+ params->u1.s.pages_in_bank[i] * PAGE_SIZE);
+ } else
#endif
-#ifdef CONFIG_ARCH_SHARK
- if (machine_is_shark()) {
- int i;
- for (i = 0; i < 4; i++) {
- unsigned int val = params->u1.s.pages_in_bank[i];
- if (!val)
- continue;
- tag = memtag(tag, val & 0xffff0000,
- (val & 0xffff) * PAGE_SIZE);
- }
+ if (machine_is_shark()) {
+ int i;
+ for (i = 0; i < 4; i++) {
+ unsigned int val = params->u1.s.pages_in_bank[i];
+ if (!val)
+ continue;
+ tag = memtag(tag, val & 0xffff0000,
+ (val & 0xffff) * PAGE_SIZE);
}
-#endif
- tag = memtag(tag, PHYS_OFFSET, params->u1.s.nr_pages * PAGE_SIZE);
- }
+ } else
+ tag = memtag(tag, PHYS_OFFSET, params->u1.s.nr_pages * PAGE_SIZE);
#ifdef CONFIG_FOOTBRIDGE
- tag = tag_next(tag);
- tag->hdr.tag = ATAG_MEMCLK;
- tag->hdr.size = tag_size(tag_memclk);
- tag->u.memclk.fmemclk = params->u1.s.mem_fclk_21285;
+ if (params->u1.s.mem_fclk_21285) {
+ tag = tag_next(tag);
+ tag->hdr.tag = ATAG_MEMCLK;
+ tag->hdr.size = tag_size(tag_memclk);
+ tag->u.memclk.fmemclk = params->u1.s.mem_fclk_21285;
+ }
#endif
#ifdef CONFIG_ARCH_ACORN
@@ -124,14 +122,22 @@ static void __init build_tag_list(struct param_struct *params, void *taglist, in
strcpy(tag->u.cmdline.cmdline, params->commandline);
tag = tag_next(tag);
- tag->hdr.tag = 0;
+ tag->hdr.tag = ATAG_NONE;
tag->hdr.size = 0;
memmove(params, taglist, ((int)tag) - ((int)taglist) +
sizeof(struct tag_header));
}
-void __init convert_to_tag_list(struct param_struct *params, int mem_init)
+void __init convert_to_tag_list(struct tag *tags)
+{
+ struct param_struct *params = (struct param_struct *)tags;
+ build_tag_list(params, &params->u2);
+}
+
+void __init squash_mem_tags(struct tag *tag)
{
- build_tag_list(params, &params->u2, mem_init);
+ for (; tag->hdr.size; tag = tag_next(tag))
+ if (tag->hdr.tag == ATAG_MEM)
+ tag->hdr.tag = ATAG_NONE;
}
diff --git a/uClinux-2.4.20-uc1/arch/armnommu/kernel/process.c b/uClinux-2.4.20-uc1/arch/armnommu/kernel/process.c
index 51356c1..ae18aab 100644
--- a/uClinux-2.4.20-uc1/arch/armnommu/kernel/process.c
+++ b/uClinux-2.4.20-uc1/arch/armnommu/kernel/process.c
@@ -385,20 +385,20 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
{
pid_t __ret;
- __asm__ __volatile__(
- "orr r0, %1, %2 @ kernel_thread sys_clone
- mov r1, #0
- "__syscall(clone)"
- movs %0, r0 @ if we are the child
- bne 1f
- mov fp, #0 @ ensure that fp is zero
- mov r0, %4
- mov lr, pc
- mov pc, %3
- b sys_exit
-1: "
- : "=r" (__ret)
- : "Ir" (flags), "I" (CLONE_VM), "r" (fn), "r" (arg)
+ __asm__ __volatile__(
+ "orr r0, %1, %2 @ kernel_thread sys_clone \n\
+ mov r1, #0 \n\
+ "__syscall(clone)" \n\
+ movs %0, r0 @ if we are the child \n\
+ bne 1f \n\
+ mov fp, #0 @ ensure that fp is zero \n\
+ mov r0, %4 \n\
+ mov lr, pc \n\
+ mov pc, %3 \n\
+ b sys_exit \n\
+1: "
+ : "=r" (__ret)
+ : "Ir" (flags), "I" (CLONE_VM), "r" (fn), "r" (arg)
: "r0", "r1", "lr");
return __ret;
}
diff --git a/uClinux-2.4.20-uc1/arch/armnommu/kernel/semaphore.c b/uClinux-2.4.20-uc1/arch/armnommu/kernel/semaphore.c
index 969f095..cb2a595 100644
--- a/uClinux-2.4.20-uc1/arch/armnommu/kernel/semaphore.c
+++ b/uClinux-2.4.20-uc1/arch/armnommu/kernel/semaphore.c
@@ -177,82 +177,82 @@ int __down_trylock(struct semaphore * sem)
* value in some cases..
*/
#ifdef CONFIG_CPU_26
-asm(" .section .text.lock, \"ax\"
- .align 5
- .globl __down_failed
-__down_failed:
- stmfd sp!, {r0 - r3, lr}
- mov r0, ip
- bl __down
- ldmfd sp!, {r0 - r3, pc}^
-
- .align 5
- .globl __down_interruptible_failed
-__down_interruptible_failed:
- stmfd sp!, {r0 - r3, lr}
- mov r0, ip
- bl __down_interruptible
- mov ip, r0
- ldmfd sp!, {r0 - r3, pc}^
-
- .align 5
- .globl __down_trylock_failed
-__down_trylock_failed:
- stmfd sp!, {r0 - r3, lr}
- mov r0, ip
- bl __down_trylock
- mov ip, r0
- ldmfd sp!, {r0 - r3, pc}^
-
- .align 5
- .globl __up_wakeup
-__up_wakeup:
- stmfd sp!, {r0 - r3, lr}
- mov r0, ip
- bl __up
- ldmfd sp!, {r0 - r3, pc}^
-
- .previous
+asm(" .section .text.lock, \"ax\" \n\
+ .align 5 \n\
+ .globl __down_failed \n\
+__down_failed: \n\
+ stmfd sp!, {r0 - r3, lr} \n\
+ mov r0, ip \n\
+ bl __down \n\
+ ldmfd sp!, {r0 - r3, pc}^ \n\
+ \n\
+ .align 5 \n\
+ .globl __down_interruptible_failed \n\
+__down_interruptible_failed: \n\
+ stmfd sp!, {r0 - r3, lr} \n\
+ mov r0, ip \n\
+ bl __down_interruptible \n\
+ mov ip, r0 \n\
+ ldmfd sp!, {r0 - r3, pc}^ \n\
+ \n\
+ .align 5 \n\
+ .globl __down_trylock_failed \n\
+__down_trylock_failed: \n\
+ stmfd sp!, {r0 - r3, lr} \n\
+ mov r0, ip \n\
+ bl __down_trylock \n\
+ mov ip, r0 \n\
+ ldmfd sp!, {r0 - r3, pc}^ \n\
+ \n\
+ .align 5 \n\
+ .globl __up_wakeup \n\
+__up_wakeup: \n\
+ stmfd sp!, {r0 - r3, lr} \n\
+ mov r0, ip \n\
+ bl __up \n\
+ ldmfd sp!, {r0 - r3, pc}^ \n\
+ \n\
+ .previous \n\
");
#else
/* 32 bit version */
-asm(" .section .text.lock, \"ax\"
- .align 5
- .globl __down_failed
-__down_failed:
- stmfd sp!, {r0 - r3, lr}
- mov r0, ip
- bl __down
- ldmfd sp!, {r0 - r3, pc}
-
- .align 5
- .globl __down_interruptible_failed
-__down_interruptible_failed:
- stmfd sp!, {r0 - r3, lr}
- mov r0, ip
- bl __down_interruptible
- mov ip, r0
- ldmfd sp!, {r0 - r3, pc}
-
- .align 5
- .globl __down_trylock_failed
-__down_trylock_failed:
- stmfd sp!, {r0 - r3, lr}
- mov r0, ip
- bl __down_trylock
- mov ip, r0
- ldmfd sp!, {r0 - r3, pc}
-
- .align 5
- .globl __up_wakeup
-__up_wakeup:
- stmfd sp!, {r0 - r3, lr}
- mov r0, ip
- bl __up
- ldmfd sp!, {r0 - r3, pc}
-
- .previous
+asm(" .section .text.lock, \"ax\" \n\
+ .align 5 \n\
+ .globl __down_failed \n\
+__down_failed: \n\
+ stmfd sp!, {r0 - r3, lr} \n\
+ mov r0, ip \n\
+ bl __down \n\
+ ldmfd sp!, {r0 - r3, pc} \n\
+ \n\
+ .align 5 \n\
+ .globl __down_interruptible_failed \n\
+__down_interruptible_failed: \n\
+ stmfd sp!, {r0 - r3, lr} \n\
+ mov r0, ip \n\
+ bl __down_interruptible \n\
+ mov ip, r0 \n\
+ ldmfd sp!, {r0 - r3, pc} \n\
+ \n\
+ .align 5 \n\
+ .globl __down_trylock_failed \n\
+__down_trylock_failed: \n\
+ stmfd sp!, {r0 - r3, lr} \n\
+ mov r0, ip \n\
+ bl __down_trylock \n\
+ mov ip, r0 \n\
+ ldmfd sp!, {r0 - r3, pc} \n\
+ \n\
+ .align 5 \n\
+ .globl __up_wakeup \n\
+__up_wakeup: \n\
+ stmfd sp!, {r0 - r3, lr} \n\
+ mov r0, ip \n\
+ bl __up \n\
+ ldmfd sp!, {r0 - r3, pc} \n\
+ \n\
+ .previous \n\
");
#endif
diff --git a/uClinux-2.4.20-uc1/arch/armnommu/kernel/setup.c b/uClinux-2.4.20-uc1/arch/armnommu/kernel/setup.c
index 05af4f1..47e475d 100644
--- a/uClinux-2.4.20-uc1/arch/armnommu/kernel/setup.c
+++ b/uClinux-2.4.20-uc1/arch/armnommu/kernel/setup.c
@@ -56,6 +56,8 @@ extern void _netarm_led_blink(void);
#endif
extern void paging_init(struct meminfo *, struct machine_desc *desc);
+extern void convert_to_tag_list(struct tag *tags);
+extern void squash_mem_tags(struct tag *tag);
extern void bootmem_init(struct meminfo *);
extern void reboot_setup(char *str);
extern unsigned long long memparse(char *ptr, char **retptr);
@@ -347,6 +349,8 @@ static int __init parse_tag_core(const struct tag *tag)
return 0;
}
+__tagtable(ATAG_CORE, parse_tag_core);
+
static int __init parse_tag_mem32(const struct tag *tag)
{
if (meminfo.nr_banks >= NR_BANKS) {
@@ -363,6 +367,8 @@ static int __init parse_tag_mem32(const struct tag *tag)
return 0;
}
+__tagtable(ATAG_MEM, parse_tag_mem32);
+
static int __init parse_tag_videotext(const struct tag *tag)
{
screen_info.orig_x = tag->u.videotext.x;
@@ -377,6 +383,8 @@ static int __init parse_tag_videotext(const struct tag *tag)
return 0;
}
+__tagtable(ATAG_VIDEOTEXT, parse_tag_videotext);
+
static int __init parse_tag_ramdisk(const struct tag *tag)
{
setup_ramdisk((tag->u.ramdisk.flags & 1) == 0,
@@ -385,12 +393,16 @@ static int __init parse_tag_ramdisk(const struct tag *tag)
return 0;
}
+__tagtable(ATAG_RAMDISK, parse_tag_ramdisk);
+
static int __init parse_tag_initrd(const struct tag *tag)
{
setup_initrd(tag->u.initrd.start, tag->u.initrd.size);
return 0;
}
+__tagtable(ATAG_INITRD, parse_tag_initrd);
+
static int __init parse_tag_serialnr(const struct tag *tag)
{
system_serial_low = tag->u.serialnr.low;
@@ -398,12 +410,16 @@ static int __init parse_tag_serialnr(const struct tag *tag)
return 0;
}
+__tagtable(ATAG_SERIAL, parse_tag_serialnr);
+
static int __init parse_tag_revision(const struct tag *tag)
{
system_rev = tag->u.revision.rev;
return 0;
}
+__tagtable(ATAG_REVISION, parse_tag_revision);
+
static int __init parse_tag_cmdline(const struct tag *tag)
{
strncpy(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE);
@@ -411,110 +427,57 @@ static int __init parse_tag_cmdline(const struct tag *tag)
return 0;
}
-/*
- * This is the core tag table; these are the tags
- * that we recognise for any machine type.
- */
-static const struct tagtable core_tagtable[] __init = {
- { ATAG_CORE, parse_tag_core },
- { ATAG_MEM, parse_tag_mem32 },
- { ATAG_VIDEOTEXT, parse_tag_videotext },
- { ATAG_RAMDISK, parse_tag_ramdisk },
- { ATAG_INITRD, parse_tag_initrd },
- { ATAG_SERIAL, parse_tag_serialnr },
- { ATAG_REVISION, parse_tag_revision },
- { ATAG_CMDLINE, parse_tag_cmdline }
-};
+__tagtable(ATAG_CMDLINE, parse_tag_cmdline);
/*
* Scan one tag table for this tag, and call its parse function.
+ * The tag table is built by the linker from all the __tagtable
+ * declarations.
*/
-static int __init
-parse_tag(const struct tagtable *tbl, int size, const struct tag *t)
+static int __init parse_tag(const struct tag *tag)
{
- int i;
+ extern struct tagtable __tagtable_begin, __tagtable_end;
+ struct tagtable *t;
- for (i = 0; i < size; i++, tbl++)
- if (t->hdr.tag == tbl->tag) {
- tbl->parse(t);
+ for (t = &__tagtable_begin; t < &__tagtable_end; t++)
+ if (tag->hdr.tag == t->tag) {
+ t->parse(tag);
break;
}
- return i < size;
+ return t < &__tagtable_end;
}
/*
* Parse all tags in the list, checking both the global and architecture
* specific tag tables.
*/
-static void __init
-parse_tags(const struct tagtable *tbl, int size, const struct tag *t)
+static void __init parse_tags(const struct tag *t)
{
- /*
- * The tag list is terminated with a zero-sized tag. Size is
- * defined to be in units of 32-bit quantities.
- */
- for (; t->hdr.size; t = (struct tag *)((u32 *)t + t->hdr.size)) {
- if (parse_tag(core_tagtable, ARRAY_SIZE(core_tagtable), t))
- continue;
-
- if (tbl && parse_tag(tbl, size, t))
- continue;
-
- printk(KERN_WARNING
- "Ignoring unrecognised tag 0x%08x\n", t->hdr.tag);
- }
+ for (; t->hdr.size; t = tag_next(t))
+ if (!parse_tag(t))
+ printk(KERN_WARNING
+ "Ignoring unrecognised tag 0x%08x\n",
+ t->hdr.tag);
}
-static void __init parse_params(struct param_struct *params)
-{
- if (params->u1.s.page_size != PAGE_SIZE) {
- printk(KERN_WARNING "Warning: bad configuration page, "
- "trying to continue\n");
- return;
- }
-
- ROOT_DEV = to_kdev_t(params->u1.s.rootdev);
- system_rev = params->u1.s.system_rev;
- system_serial_low = params->u1.s.system_serial_low;
- system_serial_high = params->u1.s.system_serial_high;
-
- if (params->u1.s.mem_fclk_21285 > 0)
- mem_fclk_21285 = params->u1.s.mem_fclk_21285;
-
- setup_ramdisk((params->u1.s.flags & FLAG_RDLOAD) == 0,
- (params->u1.s.flags & FLAG_RDPROMPT) == 0,
- params->u1.s.rd_start,
- params->u1.s.ramdisk_size);
-
- setup_initrd(params->u1.s.initrd_start,
- params->u1.s.initrd_size);
-
- if (!(params->u1.s.flags & FLAG_READONLY))
- root_mountflags &= ~MS_RDONLY;
-
- strncpy(default_command_line, params->commandline, COMMAND_LINE_SIZE);
- default_command_line[COMMAND_LINE_SIZE - 1] = '\0';
-
- if (meminfo.nr_banks == 0) {
- meminfo.nr_banks = 1;
- meminfo.bank[0].start = PHYS_OFFSET;
- meminfo.bank[0].size = params->u1.s.nr_pages << PAGE_SHIFT;
- }
-}
-
-
-/*
- * Tell the kernel about any console devices we may have, the user
- * can use bootargs select which one they get. The default will be
- * the console you register first.
- */
-
-
+static struct init_tags {
+ struct tag_header hdr1;
+ struct tag_core core;
+ struct tag_header hdr2;
+ struct tag_mem32 mem;
+ struct tag_header hdr3;
+} init_tags __initdata = {
+ { tag_size(tag_core), ATAG_CORE },
+ { 1, PAGE_SIZE, 0xff },
+ { tag_size(tag_mem32), ATAG_MEM },
+ { MEM_SIZE, PHYS_OFFSET },
+ { 0, ATAG_NONE }
+};
void __init setup_arch(char **cmdline_p)
{
- struct param_struct *params = NULL;
+ struct tag *tags = (struct tag *)&init_tags;
struct machine_desc *mdesc;
char *from = default_command_line;
int bootmap_size;
@@ -533,28 +496,28 @@ void __init setup_arch(char **cmdline_p)
reboot_setup("s");
if (mdesc->param_offset)
- params = (struct param_struct*)
- (phys_to_virt(mdesc->param_offset));
+ tags = phys_to_virt(mdesc->param_offset);
/*
* Do the machine-specific fixups before we parse the
* parameters or tags.
*/
if (mdesc->fixup)
- mdesc->fixup(mdesc, params, &from, &meminfo);
-
- if (params) {
- struct tag *tag = (struct tag *)params;
-
- /*
- * Is the first tag the CORE tag? This differentiates
- * between the tag list and the parameter table.
- */
- if (tag->hdr.tag == ATAG_CORE)
- parse_tags(mdesc->tagtable, mdesc->tagsize, tag);
- else
- parse_params(params);
- }
+ mdesc->fixup(mdesc, (struct param_struct *)tags,
+ &from, &meminfo);
+
+ /*
+ * If we have the old style parameters, convert them to
+ * a tag list.
+ */
+ if (tags->hdr.tag != ATAG_CORE)
+ convert_to_tag_list(tags);
+
+ if (tags->hdr.tag == ATAG_CORE) {
+ if (meminfo.nr_banks != 0)
+ squash_mem_tags(tags);
+ parse_tags(tags);
+ }
if (meminfo.nr_banks == 0) {
meminfo.nr_banks = 1;
diff --git a/uClinux-2.4.20-uc1/arch/armnommu/vmlinux-armv.lds.in b/uClinux-2.4.20-uc1/arch/armnommu/vmlinux-armv.lds.in
index f28e9ca..fd8776c 100644
--- a/uClinux-2.4.20-uc1/arch/armnommu/vmlinux-armv.lds.in
+++ b/uClinux-2.4.20-uc1/arch/armnommu/vmlinux-armv.lds.in
@@ -17,6 +17,9 @@ SECTIONS
__arch_info_begin = .;
*(.arch.info)
__arch_info_end = .;
+ __tagtable_begin = .;
+ *(.taglist)
+ __tagtable_end = .;
*(.data.init)
. = ALIGN(16);
__setup_start = .;
@@ -42,6 +45,7 @@ SECTIONS
*(.gnu.warning)
*(.text.lock) /* out-of-line lock text */
*(.rodata)
+ *(.rodata.str1.4)
*(.glue_7)
*(.glue_7t)
*(.kstrtab)
@@ -66,6 +70,7 @@ SECTIONS
. = ALIGN(8192);
.data : {
+ __data_start = .;
/*
* first, the init task union, aligned
* to an 8192 byte boundary.
diff --git a/uClinux-2.4.20-uc1/include/asm-armnommu/checksum.h b/uClinux-2.4.20-uc1/include/asm-armnommu/checksum.h
index 0090141..f46b478 100644
--- a/uClinux-2.4.20-uc1/include/asm-armnommu/checksum.h
+++ b/uClinux-2.4.20-uc1/include/asm-armnommu/checksum.h
@@ -55,25 +55,24 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl)
unsigned int sum, tmp1;
__asm__ __volatile__(
- "ldr %0, [%1], #4 @ ip_fast_csum
- ldr %3, [%1], #4
- sub %2, %2, #5
- adds %0, %0, %3
- ldr %3, [%1], #4
- adcs %0, %0, %3
- ldr %3, [%1], #4
- adcs %0, %0, %3
-1: ldr %3, [%1], #4
- adcs %0, %0, %3
- tst %2, #15
- subne %2, %2, #1
- bne 1b
- adc %0, %0, #0
- adds %0, %0, %0, lsl #16
- addcs %0, %0, #0x10000
- mvn %0, %0
- mov %0, %0, lsr #16
- "
+ "ldr %0, [%1], #4 @ ip_fast_csum \n"
+ "ldr %3, [%1], #4 \n"
+ "sub %2, %2, #5 \n"
+ "adds %0, %0, %3 \n"
+ "ldr %3, [%1], #4 \n"
+ "adcs %0, %0, %3 \n"
+ "ldr %3, [%1], #4 \n"
+ "adcs %0, %0, %3 \n"
+"1: ldr %3, [%1], #4 \n"
+ "adcs %0, %0, %3 \n"
+ "tst %2, #15 \n"
+ "subne %2, %2, #1 \n"
+ "bne 1b \n"
+ "adc %0, %0, #0 \n"
+ "adds %0, %0, %0, lsl #16 \n"
+ "addcs %0, %0, #0x10000 \n"
+ "mvn %0, %0 \n"
+ "mov %0, %0, lsr #16"
: "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
: "1" (iph), "2" (ihl)
: "cc");
@@ -87,8 +86,8 @@ static inline unsigned int
csum_fold(unsigned int sum)
{
__asm__(
- "adds %0, %1, %1, lsl #16 @ csum_fold
- addcs %0, %0, #0x10000"
+ "adds %0, %1, %1, lsl #16 @ csum_fold \n"
+ "addcs %0, %0, #0x10000"
: "=r" (sum)
: "r" (sum)
: "cc");
@@ -100,11 +99,11 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
unsigned int proto, unsigned int sum)
{
__asm__(
- "adds %0, %1, %2 @ csum_tcpudp_nofold
- adcs %0, %0, %3
- adcs %0, %0, %4
- adcs %0, %0, %5
- adc %0, %0, #0"
+ "adds %0, %1, %2 @ csum_tcpudp_nofold \n"
+ "adcs %0, %0, %3 \n"
+ "adcs %0, %0, %4 \n"
+ "adcs %0, %0, %5 \n"
+ "adc %0, %0, #0"
: "=&r"(sum)
: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len) << 16), "Ir" (proto << 8)
: "cc");
@@ -119,14 +118,14 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
unsigned int proto, unsigned int sum)
{
__asm__(
- "adds %0, %1, %2 @ csum_tcpudp_magic
- adcs %0, %0, %3
- adcs %0, %0, %4
- adcs %0, %0, %5
- adc %0, %0, #0
- adds %0, %0, %0, lsl #16
- addcs %0, %0, #0x10000
- mvn %0, %0"
+ "adds %0, %1, %2 @ csum_tcpudp_magic \n"
+ "adcs %0, %0, %3 \n"
+ "adcs %0, %0, %4 \n"
+ "adcs %0, %0, %5 \n"
+ "adc %0, %0, #0 \n"
+ "adds %0, %0, %0, lsl #16 \n"
+ "addcs %0, %0, #0x10000 \n"
+ "mvn %0, %0"
: "=&r"(sum)
: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (proto << 8)
: "cc");
diff --git a/uClinux-2.4.20-uc1/include/asm-armnommu/setup.h b/uClinux-2.4.20-uc1/include/asm-armnommu/setup.h
index 2175d45..a13545d 100644
--- a/uClinux-2.4.20-uc1/include/asm-armnommu/setup.h
+++ b/uClinux-2.4.20-uc1/include/asm-armnommu/setup.h
@@ -215,6 +215,9 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
#define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
+#define for_each_tag(t,base) \
+ for (t = base; t->hdr.size; t = tag_next(t))
+
/*
* Memory map description
*/