Changeset f76fed4 in mainline for arch


Ignore:
Timestamp:
2006-03-03T00:20:31Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
09c18f78
Parents:
ddcf365
Message:

Added lazy fpu context allocation.

  • threads that don't use fpu, don't get allocated fpu context
  • fpu context alignment on AMD64 nicely disappeared
Location:
arch
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/fpu_context.c

    rddcf365 rf76fed4  
    3535void fpu_context_save(fpu_context_t *fctx)
    3636{
    37         /* Align on 16-byte boundary */
    38         if (((__u64)fctx) & 0xf)
    39                 fctx = (fpu_context_t *)((((__u64)fctx) | 0xf) + 1);
    40 
    4137        __asm__ volatile (
    4238                "fxsave %0"
     
    4844void fpu_context_restore(fpu_context_t *fctx)
    4945{
    50         /* Align on 16-byte boundary */
    51         if (((__u64)fctx) & 0xf)
    52                 fctx = (fpu_context_t *)((((__u64)fctx) | 0xf) + 1);
    5346        __asm__ volatile (
    5447                "fxrstor %0"
     
    5750}
    5851
    59 void fpu_init(fpu_context_t *fctx)
     52void fpu_init()
    6053{
    6154        /* TODO: Zero all SSE, MMX etc. registers */
  • arch/ia32/include/fpu_context.h

    rddcf365 rf76fed4  
    3232#include <arch/types.h>
    3333
     34#define ARCH_HAS_FPU
     35#define FPU_CONTEXT_ALIGN 16
     36
    3437struct fpu_context {
    3538        /* TODO: We need malloc that aligns structures on 16-byte boundary */
    36         __u8 fpu[512+16];               /* FXSAVE & FXRSTOR storage area */
     39        __u8 fpu[512];          /* FXSAVE & FXRSTOR storage area */
    3740};
    3841
  • arch/ia32/src/fpu_context.c

    rddcf365 rf76fed4  
    4949}
    5050
    51 void fpu_init(fpu_context_t *fctx)
     51void fpu_init()
    5252{
    5353        __asm__ volatile (
  • arch/mips32/include/fpu_context.h

    rddcf365 rf76fed4  
    3232#include <arch/types.h>
    3333
     34#define ARCH_HAS_FPU
     35#define FPU_CONTEXT_ALIGN    sizeof(__native)
     36
    3437struct fpu_context {
    3538        __native dregs[32];
  • arch/mips32/src/fpu_context.c

    rddcf365 rf76fed4  
    5151}
    5252
    53 void fpu_init(fpu_context_t *fctx)
     53void fpu_init()
    5454{
    5555        /* TODO: Zero all registers */
Note: See TracChangeset for help on using the changeset viewer.