/* * __MEMORY_START and SIZE are the physical addresses and size of RAM.
*/ #define __MEMORY_START CONFIG_MEMORY_START #define __MEMORY_SIZE CONFIG_MEMORY_SIZE
/* * PHYSICAL_OFFSET is the offset in physical memory where the base * of the kernel is loaded.
*/ #ifdef CONFIG_PHYSICAL_START #define PHYSICAL_OFFSET (CONFIG_PHYSICAL_START - __MEMORY_START) #else #define PHYSICAL_OFFSET 0 #endif
/* * PAGE_OFFSET is the virtual address of the start of kernel address * space.
*/ #define PAGE_OFFSET CONFIG_PAGE_OFFSET
/* * Virtual to physical RAM address translation. * * In 29 bit mode, the physical offset of RAM from address 0 is visible in * the kernel virtual address space, and thus we don't have to take * this into account when translating. However in 32 bit mode this offset * is not visible (it is part of the PMB mapping) and so needs to be * added or subtracted as required.
*/ #ifdef CONFIG_PMB #define ___pa(x) ((x)-PAGE_OFFSET+__MEMORY_START) #define ___va(x) ((x)+PAGE_OFFSET-__MEMORY_START) #else #define ___pa(x) ((x)-PAGE_OFFSET) #define ___va(x) ((x)+PAGE_OFFSET) #endif
/* * PFN = physical frame number (ie PFN 0 == physical address 0) * PFN_START is the PFN of the first page of RAM. By defining this we * don't have struct page entries for the portion of address space * between physical address 0 and the start of RAM.
*/ #define PFN_START (__MEMORY_START >> PAGE_SHIFT) #define ARCH_PFN_OFFSET (PFN_START) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.