Changeset 0ca6faa in mainline


Ignore:
Timestamp:
2005-05-08T22:32:29Z (20 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2265edf
Parents:
c4a5207f
Message:

Move fpu_context switching functions from context.s to fpu_context.c on all platforms.
Add fpu_context.h.

Make before_thread_runs() arch-independent and create arch dependent version before_thread_runs_arch().

Files:
5 added
11 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/Makefile.inc

    rc4a5207f r0ca6faa  
    4545        arch/drivers/i8259.c \
    4646        arch/drivers/ega.c \
    47         arch/boot/boot.S
     47        arch/boot/boot.S \
     48        arch/fpu_context.c
    4849
    4950
  • arch/ia32/src/context.s

    rc4a5207f r0ca6faa  
    8080
    8181
    82 fpu_context_save:
    83         ret
    84 
    85 fpu_context_restore:
    86         ret
    87 
    88 fpu_lazy_context_save:
    89         pushl %eax
    90         mov 8(%esp),%eax
    91         fxsave (%eax)
    92         popl %eax
    93         ret
    94 
    95 fpu_lazy_context_restore:
    96         pushl %eax
    97         mov 8(%esp),%eax
    98         fxrstor (%eax)
    99         popl %eax
    100         ret
    101 
  • arch/ia32/src/proc/scheduler.c

    rc4a5207f r0ca6faa  
    3232#include <arch.h>
    3333
    34 void before_thread_runs(void)
     34void before_thread_runs_arch(void)
    3535{
    3636        CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-8];
  • arch/ia64/Makefile.inc

    rc4a5207f r0ca6faa  
    1919        arch/fake.s \
    2020        arch/putchar.c \
    21         arch/context.S \
    22         arch/ia64.c
     21        arch/ia64.c \
     22        arch/fpu_context.c
     23        arch/context.S
     24       
     25
  • arch/ia64/src/fake.s

    rc4a5207f r0ca6faa  
    3232.global asm_delay_loop
    3333.global userspace
    34 .global before_thread_runs
     34.global before_thread_runs_arch
    3535.global arch_late_init
    3636.global arch_post_mm_init
     
    5050.global panic
    5151
    52 before_thread_runs:
     52before_thread_runs_arch:
    5353userspace:
    5454calibrate_delay_loop:
  • arch/mips/Makefile.inc

    rc4a5207f r0ca6faa  
    3131        arch/mm/frame.c \
    3232        arch/mm/page.c \
    33         arch/mm/tlb.c
     33        arch/mm/tlb.c \
     34        arch/fpu_context.c
  • arch/mips/src/fake.s

    rc4a5207f r0ca6faa  
    3333.global asm_delay_loop
    3434.global userspace
    35 .global before_thread_runs
     35.global _before_thread_runs_arch
    3636
    37 before_thread_runs:
     37before_thread_runs_arch:
    3838userspace:
    3939calibrate_delay_loop:
  • arch/powerpc/Makefile.inc

    rc4a5207f r0ca6faa  
    1212
    1313arch_sources= \
    14         arch/powerpc.c
     14        arch/powerpc.c \
     15        arch/fpu_context.c
  • include/context.h

    rc4a5207f r0ca6faa  
    3131
    3232#include <typedefs.h>
     33#include "fpu_context.h"
     34
    3335
    3436extern int context_save(context_t *c);
    3537extern void context_restore(context_t *c) __attribute__ ((noreturn));
    3638
     39
     40
    3741#endif
  • include/proc/scheduler.h

    rc4a5207f r0ca6faa  
    6161 
    6262extern void before_thread_runs(void);
     63extern void before_thread_runs_arch(void);
    6364
    6465#endif
  • src/proc/scheduler.c

    rc4a5207f r0ca6faa  
    5555volatile int nrdy;
    5656
     57void before_thread_runs(void)
     58{
     59        before_thread_runs_arch();
     60        fpu_context_restore();
     61}
     62
     63
    5764void scheduler_init(void)
    5865{
Note: See TracChangeset for help on using the changeset viewer.