summaryrefslogtreecommitdiff
path: root/util/mkelfImage/kunzip_src/arch/i386
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2008-02-15 18:16:06 +0000
committerStefan Reinauer <stepan@openbios.org>2008-02-15 18:16:06 +0000
commitb34eea348cb7d6d9c93d17d51a1f322114b8f15d (patch)
tree38dd85932dacaa7c7a174d87307baff6210d70c4 /util/mkelfImage/kunzip_src/arch/i386
parent46fc14dcc8cdba1d66ae6fa9fdcbbf33265d676e (diff)
Importing mkelfimage from
ftp://ftp.lnxi.com/pub/mkelfImage/mkelfImage-2.7.tar.gz Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3103 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/mkelfImage/kunzip_src/arch/i386')
-rw-r--r--util/mkelfImage/kunzip_src/arch/i386/include/stddef.h15
-rw-r--r--util/mkelfImage/kunzip_src/arch/i386/include/stdint.h52
-rw-r--r--util/mkelfImage/kunzip_src/arch/i386/lib/Makefile1
-rw-r--r--util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds50
-rw-r--r--util/mkelfImage/kunzip_src/arch/i386/lib/start.S36
5 files changed, 154 insertions, 0 deletions
diff --git a/util/mkelfImage/kunzip_src/arch/i386/include/stddef.h b/util/mkelfImage/kunzip_src/arch/i386/include/stddef.h
new file mode 100644
index 0000000000..88a3b48957
--- /dev/null
+++ b/util/mkelfImage/kunzip_src/arch/i386/include/stddef.h
@@ -0,0 +1,15 @@
+#ifndef I386_STDDEF_H
+#define I386_STDDEF_H
+
+typedef long ptrdiff_t;
+typedef unsigned long size_t;
+typedef long ssize_t;
+
+typedef int wchar_t;
+typedef unsigned int wint_t;
+
+#define NULL 0
+
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+
+#endif I386_STDDEF_H
diff --git a/util/mkelfImage/kunzip_src/arch/i386/include/stdint.h b/util/mkelfImage/kunzip_src/arch/i386/include/stdint.h
new file mode 100644
index 0000000000..58d7519cde
--- /dev/null
+++ b/util/mkelfImage/kunzip_src/arch/i386/include/stdint.h
@@ -0,0 +1,52 @@
+#ifndef I386_STDINT_H
+#define I386_STDINT_H
+
+/* Exact integral types */
+typedef unsigned char uint8_t;
+typedef signed char int8_t;
+
+typedef unsigned short uint16_t;
+typedef signed short int16_t;
+
+typedef unsigned int uint32_t;
+typedef signed int int32_t;
+
+typedef unsigned long long uint64_t;
+typedef signed long long int64_t;
+
+/* Small types */
+typedef unsigned char uint_least8_t;
+typedef signed char int_least8_t;
+
+typedef unsigned short uint_least16_t;
+typedef signed short int_least16_t;
+
+typedef unsigned int uint_least32_t;
+typedef signed int int_least32_t;
+
+typedef unsigned long long uint_least64_t;
+typedef signed long long int_least64_t;
+
+/* Fast Types */
+typedef unsigned char uint_fast8_t;
+typedef signed char int_fast8_t;
+
+typedef unsigned int uint_fast16_t;
+typedef signed int int_fast16_t;
+
+typedef unsigned int uint_fast32_t;
+typedef signed int int_fast32_t;
+
+typedef unsigned long long uint_fast64_t;
+typedef signed long long int_fast64_t;
+
+/* Types for `void *' pointers. */
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+
+/* Largest integral types */
+typedef long long int intmax_t;
+typedef unsigned long long uintmax_t;
+
+
+#endif /* I386_STDINT_H */
diff --git a/util/mkelfImage/kunzip_src/arch/i386/lib/Makefile b/util/mkelfImage/kunzip_src/arch/i386/lib/Makefile
new file mode 100644
index 0000000000..df2474d210
--- /dev/null
+++ b/util/mkelfImage/kunzip_src/arch/i386/lib/Makefile
@@ -0,0 +1 @@
+ARCH_OPTIONS=
diff --git a/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds b/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds
new file mode 100644
index 0000000000..0e649005cf
--- /dev/null
+++ b/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds
@@ -0,0 +1,50 @@
+PAGE_SIZE = 4096;
+BASIC_ALIGN = 8;
+OUTPUT_FORMAT("elf32-i386")
+ENTRY(__start)
+SECTIONS
+{
+ . = PAGE_SIZE;
+ _start = .;
+ /*
+ * First we place the code and read only data (typically const declared).
+ * This get placed in rom.
+ */
+ .text : {
+ _text = .;
+ *(.text)
+ _etext = .;
+ _rodata = .;
+ *(.rodata);
+ _erodata = .;
+ }
+ /* Global data */
+ .data : {
+ _data = .;
+ *(.data)
+ CONSTRUCTORS
+ *(.got)
+ *(.sdata)
+ _edata = .;
+ }
+
+ /* Important align _bss so bss may be zeroed with quadword access */
+ . = ALIGN(BASIC_ALIGN);
+ .bss : {
+ _bss = .;
+ *(.sbss)
+ *(.scommon)
+ *(.bss)
+ *(COMMON)
+ *(.heap)
+ *(.stack)
+ /* Important align _ebss so bss may be zeroed with quadword access */
+ . = ALIGN(BASIC_ALIGN);
+ _ebss = .;
+ }
+ _end = .;
+
+ /DISCARD/ : {
+ *(*)
+ }
+}
diff --git a/util/mkelfImage/kunzip_src/arch/i386/lib/start.S b/util/mkelfImage/kunzip_src/arch/i386/lib/start.S
new file mode 100644
index 0000000000..fec7c9da66
--- /dev/null
+++ b/util/mkelfImage/kunzip_src/arch/i386/lib/start.S
@@ -0,0 +1,36 @@
+.text
+
+__original_registers:
+ .long 0, 0, 0, 0, 0, 0 , 0 , 0
+__entry:
+ .long entry
+
+.globl __start
+__start:
+ movl %eax, 0+__original_registers
+ movl %ebx, 4+__original_registers
+ movl %ecx, 8+__original_registers
+ movl %edx, 12+__original_registers
+ movl %esi, 16+__original_registers
+ movl %edi, 20+__original_registers
+ movl %esp, 24+__original_registers
+ movl %ebp, 28+__original_registers
+
+__normal_start:
+ movl $_estack, %esp
+ call kunzip
+
+.globl jmp_to_program_entry
+jmp_to_program_entry:
+ movl 4(%esp), %eax
+ movl %eax, __entry
+ movl 0+__original_registers, %eax
+ movl 4+__original_registers, %ebx
+ movl 8+__original_registers, %ecx
+ movl 12+__original_registers, %edx
+ movl 16+__original_registers, %esi
+ movl 20+__original_registers, %edi
+ movl 24+__original_registers, %esp
+ movl 28+__original_registers, %ebp
+ jmp *__entry
+ \ No newline at end of file