Changeset bc314be8 in mainline for arch/ia64/src/proc/scheduler.c


Ignore:
Timestamp:
2006-03-05T16:21:36Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
83d2d0e
Parents:
9e5938dc
Message:

ia64 work.

Change heavyweight interrupt handler to use bank 0 registers instead of AR.KR0 and AR.KR1.
This prevents userspace from the possibility to see what addresses are being used by kernel.

Store kernel stack address in bank 0 r23 instead of AR.KR7. Again, userspace will not be
able to read the address of its kernel stack.

Increase FRAME_SIZE to 64K as this is the first supported page size in which will fit
thread's combined register and memory stack. (RSE can write out as many as 16K.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia64/src/proc/scheduler.c

    r9e5938dc rbc314be8  
    3030#include <proc/thread.h>
    3131#include <arch.h>
     32#include <arch/register.h>
    3233#include <arch/mm/tlb.h>
    3334#include <config.h>
    3435#include <align.h>
    3536
    36 /** Record kernel stack address in ar.k7 and make sure it is mapped in DTR. */
     37/** Record kernel stack address in bank 0 r23 and make sure it is mapped in DTR. */
    3738void before_thread_runs_arch(void)
    3839{
     
    5051       
    5152        /*
    52          * Record address of kernel stack to ar.k7
    53          * where it will be found after switch
    54          * from userspace.
     53         * Record address of kernel stack to bank 0 r23
     54         * where it will be found after switch from userspace.
    5555         */
    56         __asm__ volatile ("mov ar.k7 = %0\n" : : "r" (THREAD->kstack));
     56        __asm__ volatile (
     57                "bsw.0\n"
     58                "mov r23 = %0\n"
     59                "bsw.1\n"
     60                 : : "r" (THREAD->kstack));
    5761}
    5862
Note: See TracChangeset for help on using the changeset viewer.