Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/libsaio/convert.h

1/*
2 * Convert.h
3 * Declare conversion utility functions
4 * --Rek
5 */
6
7#ifndef __CONVERT_H
8#define __CONVERT_H
9#include "libsaio.h"
10#include "efi.h"
11
12#define UUID_LEN16
13
14#define UUID_STR_LEN UUID_LEN*2 + 8
15
16const char * getStringFromUUID(const EFI_CHAR8* uuid);
17EFI_CHAR8* getUUIDFromString(const char *source);
18void *convertHexStr2Binary(const char *hexStr, int *outLength);
19uint32_t ascii_hex_to_int(char *buff);
20
21static inline uint16_t dp_swap16(uint16_t toswap)
22{
23 return (((toswap & 0x00FF) << 8) | ((toswap & 0xFF00) >> 8));
24}
25
26static inline uint32_t dp_swap32(uint32_t toswap)
27{
28 return ((toswap & 0x000000FF) << 24) |
29 ((toswap & 0x0000FF00) << 8 ) |
30 ((toswap & 0x00FF0000) >> 8 ) |
31 ((toswap & 0xFF000000) >> 24);
32}
33
34
35#endif
36

Archive Download this file

Revision: 2006