]>
code.delx.au - refind/blob - filesystems/fsw_base.h
3 * Base definitions switch.
7 * This code is based on:
9 * Copyright (c) 2006 Christoph Pfisterer
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are
15 * * Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
18 * * Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the
23 * * Neither the name of Christoph Pfisterer nor the names of the
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48 #include "fsw_efi_base.h"
52 #include "test/fsw_posix_base.h"
55 #ifndef FSW_DEBUG_LEVEL
57 * Global debugging level. Can be set locally for the scope of a single
58 * file by defining the macro before fsw_base.h is included.
60 #define FSW_DEBUG_LEVEL 1
65 #if FSW_DEBUG_LEVEL >= 1
66 #define FSW_MSG_ASSERT(params) FSW_MSGFUNC params
68 #define FSW_MSG_ASSERT(params)
71 #if FSW_DEBUG_LEVEL >= 2
72 #define FSW_MSG_DEBUG(params) FSW_MSGFUNC params
74 #define FSW_MSG_DEBUG(params)
77 #if FSW_DEBUG_LEVEL >= 3
78 #define FSW_MSG_DEBUGV(params) FSW_MSGFUNC params
80 #define FSW_MSG_DEBUGV(params)
84 // Documentation for system-dependent defines
88 * Signed 8-bit integer.
93 * Unsigned 8-bit integer.
98 * Signed 16-bit integer.
103 * Unsigned 16-bit integer.
108 * Signed 32-bit integer.
113 * Unsigned 32-bit integer.
118 * Signed 64-bit integer.
123 * Unsigned 64-bit integer.
128 * \def fsw_alloc(size,ptrptr)
129 * Allocate memory on the heap. This function or macro allocates \a size
130 * bytes of memory using host-specific methods. The address of the
131 * allocated memory block is stored into the pointer variable pointed
132 * to by \a ptrptr. A status code is returned; FSW_SUCCESS if the block
133 * was allocated or FSW_OUT_OF_MEMORY if there is not enough memory
134 * to allocated the requested block.
139 * Release allocated memory. This function or macro returns an allocated
140 * memory block to the heap for reuse. Does not return a status.
144 * \def fsw_memcpy(dest,src,size)
145 * Copies a block of memory from \a src to \a dest. The two memory blocks
146 * must not overlap, or the result of the operation will be undefined.
147 * Does not return a status.
151 * \def fsw_memeq(dest,src,size)
152 * Compares two blocks of memory for equality. Returns boolean true if the
153 * memory blocks are equal, boolean false if they are different.
157 * \def fsw_memzero(dest,size)
158 * Initializes a block of memory with zeros. Does not return a status.