Missing files

This commit is contained in:
balhau@balhau.net 2021-12-26 13:07:01 +00:00
parent 19299adced
commit d70ab1deda
No known key found for this signature in database
GPG key ID: 1E666F326A121830
3 changed files with 93 additions and 0 deletions

18
src/cpu/clock.hpp Normal file
View file

@ -0,0 +1,18 @@
#pragma once
#include "../platform/types.hpp"
namespace cpu
{
/**
* @brief Clock interface. This class will be filled with pure virtual functions
* that should be implemented by cpu specific code
*
*
*/
class Clock
{
public:
virtual ULong getTimestamp() = 0;
};
};

8
src/cpu/x86/clock.hpp Normal file
View file

@ -0,0 +1,8 @@
#pragma once
#include "../clock.hpp"
namespace cpu
{
}

67
src/platform/types.hpp Normal file
View file

@ -0,0 +1,67 @@
#pragma once
#include "../platform/platform.hpp"
/*
* Types for x86 architectures
*/
#ifdef ARCH_X86
// Signed type alias
typedef int Int;
typedef long Long;
typedef char Char;
typedef short Short;
typedef union
{
struct
{
Int value : 31;
Int signal : 1;
} int_with_msb;
Int signed_int;
} SignedInt;
typedef union
{
struct
{
Long value : 63;
Int signal : 1;
} long_with_msb;
} SignedLong;
// IEEE floating point alias
typedef float Float;
typedef double Double;
// Unsigned type alias
typedef unsigned char UChar;
typedef unsigned short UShort;
typedef unsigned int UInt;
typedef unsigned long int ULong;
// SSE DataTypes
#define CHAR_LEN_128 16
#define CHAR_LEN_256 32
#define INT_LEN_64 2
#define INT_LEN_128 4
#define INT_LEN_256 8
#define INT_LEN_512 16
#define LONG_LEN_64 1
#define LONG_LEN_128 2
#define LONG_LEN_256 4
#define LONG_LEN_512 8
// Masks
#define MASK_32 0xFFFFFFFF
#define MASK_16 0xFFFF
#define MASK_8 0xFF
// Shifts
#define SHIFT_32 32
#define SHIFT_16 16
#define SHIFT_8 8
#endif