Changeset 4928165 in mainline


Ignore:
Timestamp:
2016-05-08T21:18:45Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0637ddb
Parents:
a0d9abcd
Message:

Use symbolic constants instead of magic numbers

  • Use PA2KA(0) instead of 0x80000000
  • Use CONTEXT_OFFSET_SP instead of silently assuming that SP is at offset 0
Location:
kernel/arch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/smp/ap.S

    ra0d9abcd r4928165  
    3939#include <arch/cpu.h>
    4040#include <arch/cpuid.h>
     41#include <arch/context_struct.h>
    4142
    4243.section K_TEXT_START, "ax"
     
    9899start64:
    99100        movabsq $ctx, %rsp
    100         movq (%rsp), %rsp
     101        movq CONTEXT_OFFSET_SP(%rsp), %rsp
    101102       
    102103        pushq $0
  • kernel/arch/ia32/src/smp/ap.S

    ra0d9abcd r4928165  
    3838#include <arch/pm.h>
    3939#include <arch/cpu.h>
     40#include <arch/context_struct.h>
    4041
    4142.section K_TEXT_START, "ax"
     
    7475        movw %ax, %es
    7576        movw %ax, %ss
    76         movl $KA2PA(ctx), %eax  /* KA2PA((uintptr_t) &ctx) */
    77         movl (%eax), %esp
    78         subl $0x80000000, %esp  /* KA2PA(ctx.sp) */
     77        movl $KA2PA(ctx), %eax  /* KA2PA((uintptr_t) &ctx) */
     78        movl CONTEXT_OFFSET_SP(%eax), %esp
     79        subl $PA2KA(0), %esp    /* KA2PA(ctx.sp) */
    7980
    8081        /*
     
    8485        call map_kernel_pse
    8586       
    86         addl $0x80000000, %esp  /* PA2KA(ctx.sp) */
     87        addl $PA2KA(0), %esp    /* PA2KA(ctx.sp) */
    8788       
    8889        /* create the first stack frame */
Note: See TracChangeset for help on using the changeset viewer.