-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PATCH] ppc64: make arch/ppc64/boot standalone
Make the bootheader for ppc64 independent from kernel and libc headers. * add -nostdinc -isystem $gccincludes to not include libc headers * declare all functions in header files, also the stuff from string.S * declare some functions static * use stddef.h to get size_t (hopefully ok) * remove ppc32-types.h, only elf.h used the __NN types With further modifications by Paul Mackerras and Stephen Rothwell. Signed-off-by: Olaf Hering <olh@suse.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
- Loading branch information
Olaf Hering
authored and
Paul Mackerras
committed
Aug 29, 2005
1 parent
02b3e4e
commit decd300
Showing
15 changed files
with
350 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
#ifndef _PPC_BOOT_ELF_H_ | ||
#define _PPC_BOOT_ELF_H_ | ||
|
||
/* 32-bit ELF base types. */ | ||
typedef unsigned int Elf32_Addr; | ||
typedef unsigned short Elf32_Half; | ||
typedef unsigned int Elf32_Off; | ||
typedef signed int Elf32_Sword; | ||
typedef unsigned int Elf32_Word; | ||
|
||
/* 64-bit ELF base types. */ | ||
typedef unsigned long long Elf64_Addr; | ||
typedef unsigned short Elf64_Half; | ||
typedef signed short Elf64_SHalf; | ||
typedef unsigned long long Elf64_Off; | ||
typedef signed int Elf64_Sword; | ||
typedef unsigned int Elf64_Word; | ||
typedef unsigned long long Elf64_Xword; | ||
typedef signed long long Elf64_Sxword; | ||
|
||
/* These constants are for the segment types stored in the image headers */ | ||
#define PT_NULL 0 | ||
#define PT_LOAD 1 | ||
#define PT_DYNAMIC 2 | ||
#define PT_INTERP 3 | ||
#define PT_NOTE 4 | ||
#define PT_SHLIB 5 | ||
#define PT_PHDR 6 | ||
#define PT_TLS 7 /* Thread local storage segment */ | ||
#define PT_LOOS 0x60000000 /* OS-specific */ | ||
#define PT_HIOS 0x6fffffff /* OS-specific */ | ||
#define PT_LOPROC 0x70000000 | ||
#define PT_HIPROC 0x7fffffff | ||
#define PT_GNU_EH_FRAME 0x6474e550 | ||
|
||
#define PT_GNU_STACK (PT_LOOS + 0x474e551) | ||
|
||
/* These constants define the different elf file types */ | ||
#define ET_NONE 0 | ||
#define ET_REL 1 | ||
#define ET_EXEC 2 | ||
#define ET_DYN 3 | ||
#define ET_CORE 4 | ||
#define ET_LOPROC 0xff00 | ||
#define ET_HIPROC 0xffff | ||
|
||
/* These constants define the various ELF target machines */ | ||
#define EM_NONE 0 | ||
#define EM_PPC 20 /* PowerPC */ | ||
#define EM_PPC64 21 /* PowerPC64 */ | ||
|
||
#define EI_NIDENT 16 | ||
|
||
typedef struct elf32_hdr { | ||
unsigned char e_ident[EI_NIDENT]; | ||
Elf32_Half e_type; | ||
Elf32_Half e_machine; | ||
Elf32_Word e_version; | ||
Elf32_Addr e_entry; /* Entry point */ | ||
Elf32_Off e_phoff; | ||
Elf32_Off e_shoff; | ||
Elf32_Word e_flags; | ||
Elf32_Half e_ehsize; | ||
Elf32_Half e_phentsize; | ||
Elf32_Half e_phnum; | ||
Elf32_Half e_shentsize; | ||
Elf32_Half e_shnum; | ||
Elf32_Half e_shstrndx; | ||
} Elf32_Ehdr; | ||
|
||
typedef struct elf64_hdr { | ||
unsigned char e_ident[16]; /* ELF "magic number" */ | ||
Elf64_Half e_type; | ||
Elf64_Half e_machine; | ||
Elf64_Word e_version; | ||
Elf64_Addr e_entry; /* Entry point virtual address */ | ||
Elf64_Off e_phoff; /* Program header table file offset */ | ||
Elf64_Off e_shoff; /* Section header table file offset */ | ||
Elf64_Word e_flags; | ||
Elf64_Half e_ehsize; | ||
Elf64_Half e_phentsize; | ||
Elf64_Half e_phnum; | ||
Elf64_Half e_shentsize; | ||
Elf64_Half e_shnum; | ||
Elf64_Half e_shstrndx; | ||
} Elf64_Ehdr; | ||
|
||
/* These constants define the permissions on sections in the program | ||
header, p_flags. */ | ||
#define PF_R 0x4 | ||
#define PF_W 0x2 | ||
#define PF_X 0x1 | ||
|
||
typedef struct elf32_phdr { | ||
Elf32_Word p_type; | ||
Elf32_Off p_offset; | ||
Elf32_Addr p_vaddr; | ||
Elf32_Addr p_paddr; | ||
Elf32_Word p_filesz; | ||
Elf32_Word p_memsz; | ||
Elf32_Word p_flags; | ||
Elf32_Word p_align; | ||
} Elf32_Phdr; | ||
|
||
typedef struct elf64_phdr { | ||
Elf64_Word p_type; | ||
Elf64_Word p_flags; | ||
Elf64_Off p_offset; /* Segment file offset */ | ||
Elf64_Addr p_vaddr; /* Segment virtual address */ | ||
Elf64_Addr p_paddr; /* Segment physical address */ | ||
Elf64_Xword p_filesz; /* Segment size in file */ | ||
Elf64_Xword p_memsz; /* Segment size in memory */ | ||
Elf64_Xword p_align; /* Segment alignment, file & memory */ | ||
} Elf64_Phdr; | ||
|
||
#define EI_MAG0 0 /* e_ident[] indexes */ | ||
#define EI_MAG1 1 | ||
#define EI_MAG2 2 | ||
#define EI_MAG3 3 | ||
#define EI_CLASS 4 | ||
#define EI_DATA 5 | ||
#define EI_VERSION 6 | ||
#define EI_OSABI 7 | ||
#define EI_PAD 8 | ||
|
||
#define ELFMAG0 0x7f /* EI_MAG */ | ||
#define ELFMAG1 'E' | ||
#define ELFMAG2 'L' | ||
#define ELFMAG3 'F' | ||
#define ELFMAG "\177ELF" | ||
#define SELFMAG 4 | ||
|
||
#define ELFCLASSNONE 0 /* EI_CLASS */ | ||
#define ELFCLASS32 1 | ||
#define ELFCLASS64 2 | ||
#define ELFCLASSNUM 3 | ||
|
||
#define ELFDATANONE 0 /* e_ident[EI_DATA] */ | ||
#define ELFDATA2LSB 1 | ||
#define ELFDATA2MSB 2 | ||
|
||
#define EV_NONE 0 /* e_version, EI_VERSION */ | ||
#define EV_CURRENT 1 | ||
#define EV_NUM 2 | ||
|
||
#define ELFOSABI_NONE 0 | ||
#define ELFOSABI_LINUX 3 | ||
|
||
#endif /* _PPC_BOOT_ELF_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef _PPC_BOOT_PAGE_H | ||
#define _PPC_BOOT_PAGE_H | ||
/* | ||
* Copyright (C) 2001 PPC64 Team, IBM Corp | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
|
||
#ifdef __ASSEMBLY__ | ||
#define ASM_CONST(x) x | ||
#else | ||
#define __ASM_CONST(x) x##UL | ||
#define ASM_CONST(x) __ASM_CONST(x) | ||
#endif | ||
|
||
/* PAGE_SHIFT determines the page size */ | ||
#define PAGE_SHIFT 12 | ||
#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT) | ||
#define PAGE_MASK (~(PAGE_SIZE-1)) | ||
|
||
/* align addr on a size boundary - adjust address up/down if needed */ | ||
#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) | ||
#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) | ||
|
||
/* align addr on a size boundary - adjust address up if needed */ | ||
#define _ALIGN(addr,size) _ALIGN_UP(addr,size) | ||
|
||
/* to align the pointer to the (next) page boundary */ | ||
#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) | ||
|
||
#endif /* _PPC_BOOT_PAGE_H */ |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.