diff --git a/arch/x86/include/asm/tasks_types.h b/arch/x86/include/asm/tasks_types.h new file mode 100644 index 00000000..f0095bf3 --- /dev/null +++ b/arch/x86/include/asm/tasks_types.h @@ -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 + +#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 diff --git a/include/metalsvm/tasks_types.h b/include/metalsvm/tasks_types.h index 73ca13d6..29fa5337 100644 --- a/include/metalsvm/tasks_types.h +++ b/include/metalsvm/tasks_types.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #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