#include <linux/kernel.h> #include <linux/module.h> #include <linux/export.h> #include <linux/mm.h> #include <linux/vmalloc.h> #include <linux/slab.h> #include <linux/sizes.h> #include <asm/page.h> #ifdef CONFIG_MIPS #include <asm/bootinfo.h> #endif struct foo { unsigned int bar; }; struct foo *foo;
static int __init test_debug_virtual_init(void) { phys_addr_t pa; void *va; va = (void *)VMALLOC_START; pa = virt_to_phys(va); pr_info("PA: %pa for VA: 0x%lx\n", &pa, (unsigned long)va); foo = kzalloc(sizeof(*foo), GFP_KERNEL); if (!foo) return -ENOMEM; pa = virt_to_phys(foo); va = foo; pr_info("PA: %pa for VA: 0x%lx\n", &pa, (unsigned long)va); return 0; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Florian Fainelli | 95 | 100.00% | 1 | 100.00% |
Total | 95 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Florian Fainelli | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Florian Fainelli | 175 | 100.00% | 1 | 100.00% |
Total | 175 | 100.00% | 1 | 100.00% |