metalsvm/arch/x86/include/asm/stddef.h
Stefan Lankes 20c944b099 avoid a task migration during the calculation of the current task
=> temporary clearing the IF flag
2011-07-20 08:24:24 +02:00

110 lines
2.5 KiB
C

/*
* Copyright 2010 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.
*/
/**
* @author Stefan Lankes
* @file arch/x86/include/asm/stddef.h
* @brief Standard datatypes
*
* This file contains typedefs for standard datatypes for numerical and character values.
*/
#ifndef __ARCH_STDDEF_H__
#define __ARCH_STDDEF_H__
#ifdef __cplusplus
extern "C" {
#endif
/// A popular type for addresses
typedef unsigned long size_t;
/// Pointer differences
typedef long ptrdiff_t;
#ifdef __KERNEL__
typedef long ssize_t;
typedef long off_t;
#endif
/// Unsigned 64 bit integer
typedef unsigned long long uint64_t;
/// Signed 64 bit integer
typedef long long int64_t;
/// Unsigned 32 bit integer
typedef unsigned int uint32_t;
/// Signed 32 bit integer
typedef int int32_t;
/// Unsigned 16 bit integer
typedef unsigned short uint16_t;
/// Signed 16 bit integer
typedef short int16_t;
/// Unsigned 8 bit integer (/char)
typedef unsigned char uint8_t;
/// Signed 8 bit integer (/char)
typedef char int8_t;
/// 16 bit wide char type
typedef unsigned short wchar_t;
#ifndef _WINT_T
#define _WINT_T
typedef unsigned int wint_t;
#endif
/** @brief This defines what the stack looks like after an ISR was called.
*
* All the interrupt handler routines use this type for their only parameter.
*/
struct state {
/// EDI register
unsigned int edi;
/// ESI register
unsigned int esi;
/// EBP register
unsigned int ebp;
/// ESP register
unsigned int esp;
/// EBX register
unsigned int ebx;
/// EDX register
unsigned int edx;
/// ECX register
unsigned int ecx;
/// EAX register
unsigned int eax; /* pushed by 'pusha' */
/// Interrupt number
unsigned int int_no;
// pushed by the processor automatically
unsigned int error;
unsigned int eip;
unsigned int cs;
unsigned int eflags;
unsigned int useresp;
unsigned int ss;
};
uint32_t apic_cpu_id(void);
#define smp_id apic_cpu_id
#ifdef __cplusplus
}
#endif
#endif