Changeset fa0dfaf in mainline


Ignore:
Timestamp:
2005-08-30T20:15:50Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba18512
Parents:
d0c30f7
Message:

Context-save/restore in AMD64

Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/Makefile.inc

    rd0c30f7 rfa0dfaf  
    1919        arch/boot/boot.S \
    2020        arch/boot/memmap.S \
    21         arch/pm.c
     21        arch/pm.c \
     22        arch/context.S
  • arch/amd64/include/asm.h

    rd0c30f7 rfa0dfaf  
    3333#include <config.h>
    3434
     35void asm_delay_loop(__u32 t);
     36
    3537/* TODO: implement the real stuff */
    3638static inline __address get_stack_base(void)
     
    3941}
    4042
     43static inline void cpu_sleep(void) { __asm__("hlt"); };
     44
    4145#endif
  • arch/amd64/include/context.h

    rd0c30f7 rfa0dfaf  
    3030#define __amd64_CONTEXT_H__
    3131
    32 #include <arch/types.h>
     32#ifndef __amd64_TYPES_H__
     33#  include <arch/types.h>
     34#endif
    3335
    34 #define SP_DELTA        0
     36#define SP_DELTA     8
    3537
    3638struct context {
    37         __u64 sp;
    38         __u64 pc;
    39        
    40         pri_t pri;
     39    __u64 sp;
     40    __u64 pc;
     41   
     42    __u64 rbx;
     43    __u64 rbp;
     44
     45    __u64 r12;
     46    __u64 r13;
     47    __u64 r14;
     48    __u64 r15;
     49
     50    pri_t pri;
    4151} __attribute__ ((packed));
    4252
  • arch/amd64/include/types.h

    rd0c30f7 rfa0dfaf  
    2727 */
    2828
    29 #ifndef __TYPES_H__
    30 #define __TYPES_H__
     29#ifndef __amd64_TYPES_H__
     30#define __amd64_TYPES_H__
    3131
    3232#define NULL 0
     
    4141typedef __u64 __address;
    4242
    43 typedef __u32 pri_t;
     43/* Flags of processor (return value of cpu_priority_high()) */
     44typedef __u64 pri_t;
    4445
    4546typedef __u64 __native;
  • arch/amd64/src/dummy.s

    rd0c30f7 rfa0dfaf  
    3030
    3131.global memcopy
     32.global memcpy
    3233.global cpu_priority_high
    3334.global cpu_priority_low
     
    3536.global cpu_priority_restore
    3637.global memsetb
    37 .global context_save
    38 .global context_restore
    3938.global userspace
    4039.global before_thread_runs_arch
     
    5453.global frame_arch_init
    5554.global dummy
     55.global asm_delay_loop
    5656
     57memcpy:
    5758memcopy:
    5859cpu_priority_high:
     
    6162cpu_priority_read:
    6263memsetb:
    63 context_save:
    64 context_restore:
     64asm_delay_loop:
    6565before_thread_runs_arch:
    6666userspace:
  • src/build.amd64

    rd0c30f7 rfa0dfaf  
    11#! /bin/sh
    22
     3set -e
     4
     5(cd ../arch/amd64/src;make gencontext;./gencontext)
    36make all ARCH=amd64
Note: See TracChangeset for help on using the changeset viewer.