add space to store the FPU context
This commit is contained in:
parent
a9c4b5ddc0
commit
d8ad0b8dce
2 changed files with 72 additions and 2 deletions
67
arch/x86/include/asm/tasks_types.h
Normal file
67
arch/x86/include/asm/tasks_types.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright 2011 Stefan Lankes, Chair for Operating Systems,
|
||||
* RWTH Aachen University
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is part of MetalSVM.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __ARCH_TASKS_TYPES__
|
||||
#define __ARCH_TASKS_TYPES__
|
||||
|
||||
#include <metalsvm/stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
long cwd;
|
||||
long swd;
|
||||
long twd;
|
||||
long fip;
|
||||
long fcs;
|
||||
long foo;
|
||||
long fos;
|
||||
long st_space[20];
|
||||
long status;
|
||||
} i387_fsave_t;
|
||||
|
||||
typedef struct i387_fxsave_struct {
|
||||
unsigned short cwd;
|
||||
unsigned short swd;
|
||||
unsigned short twd;
|
||||
unsigned short fop;
|
||||
long fip;
|
||||
long fcs;
|
||||
long foo;
|
||||
long fos;
|
||||
long mxcsr;
|
||||
long reserved;
|
||||
long st_space[32];
|
||||
long xmm_space[32];
|
||||
long padding[56];
|
||||
} i387_fxsave_t __attribute__ ((aligned (16)));
|
||||
|
||||
union fpu_union {
|
||||
i387_fsave_t fsave;
|
||||
i387_fxsave_t fxsave;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -33,6 +33,7 @@
|
|||
#include <metalsvm/vma.h>
|
||||
#include <metalsvm/spinlock_types.h>
|
||||
#include <metalsvm/mailbox_types.h>
|
||||
#include <asm/tasks_types.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -57,9 +58,9 @@ typedef struct task {
|
|||
uint32_t status;
|
||||
/// Usage in number of pages
|
||||
atomic_int32_t user_usage;
|
||||
/// Avoids concurrent access to the page directory
|
||||
/// Avoids concurrent access to the page directory
|
||||
spinlock_t pgd_lock;
|
||||
/// pointer to the page directory
|
||||
/// pointer to the page directory
|
||||
struct page_dir* pgd;
|
||||
/// Lock for the VMA_list
|
||||
spinlock_t vma_lock;
|
||||
|
@ -69,6 +70,8 @@ typedef struct task {
|
|||
mailbox_wait_msg_t inbox;
|
||||
/// Mail outbox array
|
||||
mailbox_wait_msg_t* outbox[MAX_TASKS];
|
||||
/// FPU state
|
||||
union fpu_union fpu_state;
|
||||
} __attribute__((packed)) task_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Reference in a new issue