60 #define MEMMAP_TAG( start, count, include_start, include_length, \ 62 ( ( (start) << 16 ) | ( ( (count) - 1 ) << 24 ) | \ 63 ( (ignore) << 10 ) | ( (include_length) << 9 ) | \ 64 ( (include_start) << 8 ) | (scale) ) 72 #define MEMMAP_COUNT( tag ) ( ( ( (tag) >> 24 ) & 0xff ) + 1 ) 80 #define MEMMAP_START( tag ) ( ( (tag) >> 16 ) & 0xff ) 88 #define MEMMAP_IGNORE_NONEXISTENT( tag ) ( (tag) & 0x00000400UL ) 96 #define MEMMAP_INCLUDE_LENGTH( tag ) ( (tag) & 0x00000200UL ) 104 #define MEMMAP_INCLUDE_START( tag ) ( (tag) & 0x00000100UL ) 112 #define MEMMAP_SCALE( tag ) ( (tag) & 0x3f ) 150 int ignore_nonexistent;
160 DBGC (
settings,
"MEMMAP start %d count %d %s%s%s%s scale %d\n",
161 start,
count, ( include_start ?
"start" :
"" ),
162 ( ( include_start && include_length ) ?
"+" :
"" ),
163 ( include_length ?
"length" :
"" ),
164 ( ignore_nonexistent ?
" ignore" :
"" ), scale );
173 if ( i >= memmap.
count ) {
174 if ( ignore_nonexistent ) {
185 if ( include_start ) {
190 if ( include_length ) {
193 i, ( region->
end - region->
start ) );
233 "memmap" ) ) != 0 ) {
234 DBG (
"MEMMAP could not register settings: %s\n",
248 .description =
"Memory size (in MB)",
250 .type = &setting_type_int32,
struct arbelprm_rc_send_wqe rc
void get_memmap(struct memory_map *memmap)
Get memory map.
const struct setting memsize_setting __setting(SETTING_MISC, memsize)
Memory map predefined settings.
#define MEMMAP_COUNT(tag)
Extract number of regions from setting tag.
unsigned int count
Number of used regions.
#define MEMMAP_INCLUDE_LENGTH(tag)
Extract length inclusion flag from setting tag.
#define ENOENT
No such file or directory.
unsigned long long uint64_t
#define SETTING_MISC
Miscellaneous settings.
#define MEMMAP_SCALE(tag)
Extract scale factor from setting tag.
struct init_fn memmap_settings_init_fn __init_fn(INIT_NORMAL)
Memory map settings initialiser.
static int memmap_settings_applies(struct settings *settings __unused, const struct setting *setting)
Check applicability of memory map setting.
static struct settings_operations memmap_settings_operations
Memory map settings operations.
uint32_t start
Starting offset.
struct memory_region regions[MAX_MEMORY_REGIONS]
Memory regions.
uint64_t tag
Setting tag, if applicable.
#define MEMMAP_TAG(start, count, include_start, include_length, ignore, scale)
Construct memory map setting tag.
#define INIT_NORMAL
Normal initialisation.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define __unused
Declare a variable or data structure as unused.
An initialisation function.
static int memmap_settings_fetch(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of memory map setting.
uint16_t count
Number of entries.
const struct setting_type * type
Setting type.
static void memmap_settings_init(void)
Initialise memory map settings.
char * strerror(int errno)
Retrieve string representation of error number.
static const struct settings_scope memmap_settings_scope
Memory map settings scope.
#define MEMMAP_START(tag)
Extract starting region from setting tag.
Settings block operations.
struct list_head siblings
Sibling settings blocks.
static struct settings memmap_settings
Memory map settings.
uint64_t start
Physical start address.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define cpu_to_be64(value)
uint8_t data[48]
Additional event data.
int(* applies)(struct settings *settings, const struct setting *setting)
Check applicability of setting.
struct list_head children
Child settings blocks.
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
#define DBG(...)
Print a debugging message.
#define LIST_HEAD_INIT(list)
Initialise a static list head.
const struct settings_scope * scope
Setting scope (or NULL)
#define MEMMAP_IGNORE_NONEXISTENT(tag)
Extract ignore flag from setting tag.
uint64_t end
Physical end address.
#define NULL
NULL pointer (VOID *)
struct refcnt * refcnt
Reference counter.
#define MEMMAP_INCLUDE_START(tag)
Extract start address inclusion flag from setting tag.