Changeset 157 for trunk/kernel/libk


Ignore:
Timestamp:
Jul 7, 2017, 1:48:48 PM (4 years ago)
Author:
max@…
Message:

add the x86_64 flag

Location:
trunk/kernel/libk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/elf.c

    r156 r157  
    4646           && ((header->e_machine == EM_MIPS) ||
    4747               (header->e_machine == EM_MIPS_RS3_LE) ||
    48                (header->e_machine == EM_386))
     48               (header->e_machine == EM_X86_64))
    4949           && (header->e_type == ET_EXEC))
    5050                return true;
     
    6464        if( (header->e_machine == EM_MIPS) ||
    6565            (header->e_machine == EM_MIPS_RS3_LE) ||
    66             (header->e_machine == EM_386) )
    67                 printk("\n[ERROR] in %s : unexpected core / accept only MIPS or 80386\n", __FUNCTION__ );
     66            (header->e_machine == EM_X86_64) )
     67                printk("\n[ERROR] in %s : unexpected core / accept only MIPS or x86_64\n", __FUNCTION__ );
    6868
    6969        if( header->e_type == ET_EXEC )
  • trunk/kernel/libk/elf.h

    r156 r157  
    2424#include <hal_types.h>
    2525
    26 /* Standard ELF types.  */
     26/*
     27 * Standard ELF types.
     28 */
    2729
    28 /* Type for a 16-bit quantity.  */
     30/* Type for a 16-bit quantity. */
    2931typedef uint16_t Elf32_Half;
    3032
    31 /* Types for signed and unsigned 32-bit quantities.  */
     33/* Types for signed and unsigned 32-bit quantities. */
    3234typedef uint32_t Elf32_Word;
    3335typedef int32_t  Elf32_Sword;
    3436
    35 /* Types for signed and unsigned 64-bit quantities.  */
    36 typedef uint64_t Elf32_Xword;
    37 typedef int64_t  Elf32_Sxword;
    38 
    39 /* Type of addresses.  */
     37/* Type of addresses. */
    4038typedef uint32_t Elf32_Addr;
    4139
    42 /* Type of file offsets.  */
     40/* Type of file offsets. */
    4341typedef uint32_t Elf32_Off;
    4442
    45 /* Type for section indices, which are 16-bit quantities.  */
     43/* Type for section indices, which are 16-bit quantities. */
    4644typedef uint16_t Elf32_Section;
    4745
    48 /* Type for version symbol information.  */
     46/* Type for version symbol information. */
    4947typedef Elf32_Half Elf32_Versym;
    5048
     
    7472Elf32_Ehdr;
    7573
    76 /* Fields in the e_ident array.  The EI_* macros are indices into the
    77    array.  The macros under each EI_* macro are the values the byte
    78    may have.  */
    79 
     74/*
     75 * Fields in the e_ident array. The EI_* macros are indices into the
     76 * array. The macros under each EI_* macro are the values the byte
     77 * may have.
     78 */
    8079#define EI_MAG0         0               /* File identification byte 0 index */
    8180#define ELFMAG0         0x7f            /* Magic number byte 0 */
     
    8988#define EI_MAG3         3               /* File identification byte 3 index */
    9089#define ELFMAG3         'F'             /* Magic number byte 3 */
    91 
    9290
    9391#define EI_CLASS        4               /* File class byte index */
     
    109107
    110108/* Legal values for e_type (object file type).  */
    111 
    112109#define ET_NONE         0               /* No file type */
    113110#define ET_REL          1               /* Relocatable file */
     
    122119
    123120/* Legal values for e_machine (architecture).  */
    124 
    125121#define EM_NONE          0              /* No machine */
    126 #define EM_386           3              /* Intel 80386 */
    127 #define EM_860           7              /* Intel 80860 */
    128122#define EM_MIPS          8              /* MIPS R3000 big-endian */
    129123#define EM_MIPS_RS3_LE  10              /* MIPS R3000 little-endian */
     
    131125#define EM_PPC64        21              /* PowerPC 64-bit */
    132126#define EM_ARM          40              /* ARM */
     127#define EM_X86_64       62      /* AMD x86-64 architecture */
    133128
    134129/* Legal values for e_version (version).  */
    135 
    136130#define EV_NONE         0               /* Invalid ELF version */
    137131#define EV_CURRENT      1               /* Current version */
     
    154148
    155149/* Legal values for p_type (segment type).  */
    156 
    157150#define PT_NULL         0               /* Program header table entry unused */
    158151#define PT_LOAD         1               /* Loadable program segment */
     
    177170
    178171/* Legal values for p_flags (segment flags).  */
    179 
    180172#define PF_X            (1 << 0)        /* Segment is executable */
    181173#define PF_W            (1 << 1)        /* Segment is writable */
     
    183175#define PF_MASKOS       0x0ff00000      /* OS-specific */
    184176#define PF_MASKPROC     0xf0000000      /* Processor-specific */
    185 
    186177
    187178
Note: See TracChangeset for help on using the changeset viewer.