Overview   API Reference  

efi.hpp

00001 #if !defined(__EFI_HPP__)
00002 #define __EFI_HPP__
00003 
00004 //
00005 // local includes
00006 //
00007 #include "core/common.hpp"
00008 
00012 struct efi
00013 {
00017     typedef uint16_t uchar_t;
00018 
00022     typedef uint8_t guid_t[16];
00023 
00024     // mandated by the EFI specification
00025     static_assert(sizeof(uchar_t) == 2, "uchar_t's size must be 2");
00026     static_assert(sizeof(guid_t) == 16, "guid_t's size must be 16");
00027 
00031     static inline bool is_null_guid(const guid_t guid)
00032     {
00033         for (size_t i=0; i < sizeof(guid); i++)
00034             if (guid[i]) return false;
00035         return true;
00036     }
00037 
00041     static string guid2string(const guid_t guid);
00042 
00046     static inline uint32_t crc32(const uint8_t *buffer, uint32_t length)
00047     {
00048         return crc32le(~0u, buffer, length) ^ ~0u;
00049     }
00050 };
00051 
00052 #endif
00053 
00054 // ***** end of source ***** //
00055 

L4vmm Reference Manual, written by Mario Schwalbe  © 2006-2008