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 ) 144 unsigned int index = 0;
150 int ignore_nonexistent;
159 DBGC (
settings,
"MEMMAP start %d count %d %s%s%s%s scale %d\n",
160 start,
count, ( include_start ?
"start" :
"" ),
161 ( ( include_start && include_length ) ?
"+" :
"" ),
162 ( include_length ?
"length" :
"" ),
163 ( ignore_nonexistent ?
" ignore" :
"" ), scale );
177 if ( include_start ) {
180 ( (
unsigned long long ) region.
min ) );
182 if ( include_length ) {
185 ( (
unsigned long long )
195 if (
count && ( ! ignore_nonexistent ) ) {
237 "memmap" ) ) != 0 ) {
238 DBG (
"MEMMAP could not register settings: %s\n",
253 .description =
"Memory size (in MB)",
255 .type = &setting_type_int32,
struct arbelprm_rc_send_wqe rc
const struct setting memsize_setting __setting(SETTING_MISC, memsize)
Memory map predefined settings.
#define MEMMAP_COUNT(tag)
Extract number of regions from setting tag.
#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.
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
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.
#define for_each_memmap(region, hide)
Iterate over memory regions.
#define __unused
Declare a variable or data structure as unused.
static unsigned int 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.
unsigned int flags
Region flags.
Settings block operations.
struct list_head siblings
Sibling settings blocks.
static struct settings memmap_settings
Memory map settings.
static uint64_t memmap_size(const struct memmap_region *region)
Get remaining size of memory region (from the described address upwards)
#define MEMMAP_FL_MEMORY
Contains memory.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define cpu_to_be64(value)
uint8_t data[48]
Additional event data.
uint64_t min
Minimum address in region.
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.
A memory region descriptor.
#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.
#define NULL
NULL pointer (VOID *)
struct refcnt * refcnt
Reference counter.
#define MEMMAP_INCLUDE_START(tag)
Extract start address inclusion flag from setting tag.