Changeset cfdeedc in mainline for kernel/arch/ppc32/src/exception.S


Ignore:
Timestamp:
2018-10-21T23:12:23Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf05c74
Parents:
d59718e
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-21 22:53:48)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-21 23:12:23)
Message:

Keep kernel in ELF format

By keeping kernel in an ELF file (instead of converting it to
a flat binary), we can use the information it contains, like
symbol table and debug info.

We can also later implement more advanced functionality, like
loading kernel at multiple discontiguous blocks, or loading
a position-independent kernel at a randomized address.

Currently the functionality is quite restricted, to keep changes
to a minimum. Code in boot/generic/src/kernel.c validates that
the kernel image was built with the same addresses as the boot
loader uses, giving an extra level of sanity checking compared
to a flat binary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/exception.S

    rd59718e rcfdeedc  
    126126.endm
    127127
    128 .org 0x100
     128// XXX: K_UNMAPPED_TEXT_START section starts at 0x100,
     129// so all the following .org directives are relative to that.
     130#define ABSOLUTE(x) ((x) - 0x100)
     131
     132.org ABSOLUTE(0x100)
    129133SYMBOL(exc_system_reset)
    130134        CONTEXT_STORE
     
    133137        b jump_to_kernel
    134138
    135 .org 0x200
     139.org ABSOLUTE(0x200)
    136140SYMBOL(exc_machine_check)
    137141        CONTEXT_STORE
     
    140144        b jump_to_kernel
    141145
    142 .org 0x300
     146.org ABSOLUTE(0x300)
    143147SYMBOL(exc_data_storage)
    144148        CONTEXT_STORE
     
    147151        b jump_to_kernel
    148152
    149 .org 0x400
     153.org ABSOLUTE(0x400)
    150154SYMBOL(exc_instruction_storage)
    151155        CONTEXT_STORE
     
    154158        b jump_to_kernel
    155159
    156 .org 0x500
     160.org ABSOLUTE(0x500)
    157161SYMBOL(exc_external)
    158162        CONTEXT_STORE
     
    161165        b jump_to_kernel
    162166
    163 .org 0x600
     167.org ABSOLUTE(0x600)
    164168SYMBOL(exc_alignment)
    165169        CONTEXT_STORE
     
    168172        b jump_to_kernel
    169173
    170 .org 0x700
     174.org ABSOLUTE(0x700)
    171175SYMBOL(exc_program)
    172176        CONTEXT_STORE
     
    175179        b jump_to_kernel
    176180
    177 .org 0x800
     181.org ABSOLUTE(0x800)
    178182SYMBOL(exc_fp_unavailable)
    179183        CONTEXT_STORE
     
    182186        b jump_to_kernel
    183187
    184 .org 0x900
     188.org ABSOLUTE(0x900)
    185189SYMBOL(exc_decrementer)
    186190        CONTEXT_STORE
     
    189193        b jump_to_kernel
    190194
    191 .org 0xa00
     195.org ABSOLUTE(0xa00)
    192196SYMBOL(exc_reserved0)
    193197        CONTEXT_STORE
     
    196200        b jump_to_kernel
    197201
    198 .org 0xb00
     202.org ABSOLUTE(0xb00)
    199203SYMBOL(exc_reserved1)
    200204        CONTEXT_STORE
     
    203207        b jump_to_kernel
    204208
    205 .org 0xc00
     209.org ABSOLUTE(0xc00)
    206210SYMBOL(exc_syscall)
    207211        CONTEXT_STORE
     
    209213        b jump_to_kernel_syscall
    210214
    211 .org 0xd00
     215.org ABSOLUTE(0xd00)
    212216SYMBOL(exc_trace)
    213217        CONTEXT_STORE
     
    216220        b jump_to_kernel
    217221
    218 .org 0x1000
     222.org ABSOLUTE(0x1000)
    219223SYMBOL(exc_itlb_miss)
    220224        CONTEXT_STORE
     
    223227        b jump_to_kernel
    224228
    225 .org 0x1100
     229.org ABSOLUTE(0x1100)
    226230SYMBOL(exc_dtlb_miss_load)
    227231        CONTEXT_STORE
     
    230234        b jump_to_kernel
    231235
    232 .org 0x1200
     236.org ABSOLUTE(0x1200)
    233237SYMBOL(exc_dtlb_miss_store)
    234238        CONTEXT_STORE
     
    237241        b jump_to_kernel
    238242
    239 .org 0x4000
     243.org ABSOLUTE(0x4000)
    240244jump_to_kernel:
    241245        mfsrr1 r5
     
    289293        addis sp, sp, 0x8000
    290294        rfi
     295
     296/* Rest is for stack. */
     297
     298.org ABSOLUTE(0x8000)
Note: See TracChangeset for help on using the changeset viewer.