Choco OS  V.0.16.9.0
Join to the chocolate world
oc_memory.h
Go to the documentation of this file.
1 
28 #ifndef SYSTEM_LIBRARIES_INC_OC_MEMORY_H_
29 #define SYSTEM_LIBRARIES_INC_OC_MEMORY_H_
30 
31 #include <oc_stdtypes.h>
32 
38 #define _________________________________________MACROS_SECTION_____________________________________________________________________________
39 
40 #define oC_Bits(b) (b / 8 + (((b % 8) != 0) ? 1 : 0) )
41 #define oC_kBits(kb) (oC_Bits(1024) * (kb))
42 #define oC_MBits(Mb) (oC_kBits(1024)* (Mb))
43 #define oC_GBits(Gb) (oC_MBits(1024)* (Gb))
44 #define oC_TBits(Tb) (oC_GBits(1024)* (Tb))
45 
46 #define oC_Bytes(B) (B)
47 #define oC_kBytes(kB) (oC_Bytes(1024) * (kB))
48 #define oC_MBytes(MB) (oC_kBytes(1024)* (MB))
49 #define oC_GBytes(GB) (oC_MBytes(1024)* (GB))
50 #define oC_TBytes(TB) (oC_GBytes(1024)* (TB))
51 
52 #define oC_MemorySize_b(V) oC_Bits(V)
53 #define oC_MemorySize_kb(V) oC_kBits(V)
54 #define oC_MemorySize_Mb(V) oC_MBits(V)
55 #define oC_MemorySize_Gb(V) oC_GBits(V)
56 #define oC_MemorySize_Tb(V) oC_TBits(V)
57 
58 #define oC_MemorySize_B(V) oC_Bytes(V)
59 #define oC_MemorySize_kB(V) oC_kBytes(V)
60 #define oC_MemorySize_MB(V) oC_MBytes(V)
61 #define oC_MemorySize_GB(V) oC_GBytes(V)
62 #define oC_MemorySize_TB(V) oC_TBytes(V)
63 
64 //==========================================================================================================================================
74 //==========================================================================================================================================
75 #define oC_Access_(ACCESS_SHORTCUT) oC_1WORD_FROM_2(oC_Access_ , ACCESS_SHORTCUT)
76 
77 #undef _________________________________________MACROS_SECTION_____________________________________________________________________________
78 
79 typedef oC_UInt_t oC_MemorySize_t;
80 
81 //==========================================================================================================================================
88 //==========================================================================================================================================
89 typedef enum
90 {
92  oC_Access_Read = (1<<0),
93  oC_Access_Write = (1<<1),
94  oC_Access_Execute = (1<<2),
101 } oC_Access_t;
102 
103 #endif /* SYSTEM_LIBRARIES_INC_OC_MEMORY_H_ */
If this flag is set it does mean, that this resource is executable.
Definition: oc_memory.h:94
If this flag is set it does mean, that this resource is readable.
Definition: oc_memory.h:92
None access is allowed.
Definition: oc_memory.h:91
All access allowed.
Definition: oc_memory.h:100
oC_Access_t
Type for storing access (R/W/RW)
Definition: oc_memory.h:89
If this flag is set it does mean, that this resource is writable.
Definition: oc_memory.h:93
FILE__DESCRIPTION