Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
memmap.c File Reference
#include <linux/string.h>
#include <linux/firmware-map.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/bootmem.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  firmware_map_entry
 
struct  memmap_attribute
 

Macros

#define to_memmap_attr(_attr)   container_of(_attr, struct memmap_attribute, attr)
 
#define to_memmap_entry(obj)   container_of(obj, struct firmware_map_entry, kobj)
 

Functions

int __meminit firmware_map_add_hotplug (u64 start, u64 end, const char *type)
 
int __init firmware_map_add_early (u64 start, u64 end, const char *type)
 
 late_initcall (firmware_memmap_init)
 

Macro Definition Documentation

#define to_memmap_attr (   _attr)    container_of(_attr, struct memmap_attribute, attr)

Definition at line 220 of file memmap.c.

#define to_memmap_entry (   obj)    container_of(obj, struct firmware_map_entry, kobj)

Definition at line 221 of file memmap.c.

Function Documentation

int __init firmware_map_add_early ( u64  start,
u64  end,
const char type 
)

firmware_map_add_early() - Adds a firmware mapping entry. : Start of the memory range. : End of the memory range. : Type of the memory range.

Adds a firmware mapping entry. This function uses the bootmem allocator for memory allocation.

That function must be called before late_initcall.

Returns 0 on success, or -ENOMEM if no memory could be allocated.

Definition at line 188 of file memmap.c.

int __meminit firmware_map_add_hotplug ( u64  start,
u64  end,
const char type 
)

firmware_map_add_hotplug() - Adds a firmware mapping entry when we do memory hotplug. : Start of the memory range. : End of the memory range (exclusive) : Type of the memory range.

Adds a firmware mapping entry. This function is for memory hotplug, it is similar to function firmware_map_add_early(). The only difference is that it will create the syfs entry dynamically.

Returns 0 on success, or -ENOMEM if no memory could be allocated.

Definition at line 160 of file memmap.c.

late_initcall ( firmware_memmap_init  )