optical/NxBase/cpuid.h
2025-09-04 09:45:08 +08:00

48 lines
554 B
C

#ifndef __CPUID_H__
#define __CPUID_H__
#include "config.h"
#define CPUID_LEN 16
typedef union
{
u8 buff[CPUID_LEN];
u16 wbuff[CPUID_LEN/2];
struct
{
u16 word1;
u16 word2;
u16 word3;
u16 word4;
u16 word5;
u16 word6;
u16 word7;
u16 word8;
}__attribute__ ((packed)) word;
struct
{
u32 dword1;
u32 dword2;
u32 dword3;
u32 dword4;
}__attribute__ ((packed)) dword;
}CpuId;
void InitCpuIDBase(u32 base);
void GetCpuID(CpuId * pId);
void EnterCritical(void);
void ExitCritical(void);
void RestartMcu(void);
#endif