libsmbios_c library
memory.h
Go to the documentation of this file.
1 // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
2 /*
3  * Copyright (C) 2005 Dell Inc.
4  * by Michael Brown <Michael_E_Brown@dell.com>
5  * Licensed under the Open Software License version 2.1
6  *
7  * Alternatively, you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published
9  * by the Free Software Foundation; either version 2 of the License,
10  * or (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  * See the GNU General Public License for more details.
16  */
17 
18 #ifndef C_MEMORY_H
19 #define C_MEMORY_H
20 
21 // include smbios_c/compat.h first
22 #include "smbios_c/compat.h"
23 #include "smbios_c/types.h"
24 
26 
40 LIBSMBIOS_C_DLL_SPEC int memory_read(void *buffer, u64 offset, size_t length);
41 
55 LIBSMBIOS_C_DLL_SPEC int memory_write(void *buffer, u64 offset, size_t length);
56 
68 LIBSMBIOS_C_DLL_SPEC s64 memory_search(const char *pat, size_t patlen, u64 start, u64 end, u64 stride);
69 
70 // Following calls must be properly nested in equal pairs
71 
84 
97 
103 
104 
106 
107 #endif /* MEMORY_H */
EXTERN_C_BEGIN
#define EXTERN_C_BEGIN
Definition: compat.h:55
types.h
memory_strerror
LIBSMBIOS_C_DLL_SPEC const char * memory_strerror()
Returns string describing the last error condition.
memory_write
LIBSMBIOS_C_DLL_SPEC int memory_write(void *buffer, u64 offset, size_t length)
Write a buffer to a physical memory address.
EXTERN_C_END
#define EXTERN_C_END
Definition: compat.h:56
memory_search
LIBSMBIOS_C_DLL_SPEC s64 memory_search(const char *pat, size_t patlen, u64 start, u64 end, u64 stride)
Search a range of physical addresses for a pattern.
LIBSMBIOS_C_DLL_SPEC
#define LIBSMBIOS_C_DLL_SPEC
Definition: compat.h:48
memory_suggest_close
LIBSMBIOS_C_DLL_SPEC void memory_suggest_close()
Optimize memory device access - request memory device be closed between calls.
compat.h
memory_suggest_leave_open
LIBSMBIOS_C_DLL_SPEC void LIBSMBIOS_C_DLL_SPEC memory_suggest_leave_open()
Optimize memory device access - request memory device be kept open between calls.
memory_read
LIBSMBIOS_C_DLL_SPEC int memory_read(void *buffer, u64 offset, size_t length)
Read byte range from physical memory address.