diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2005-09-10 13:44:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 15:00:18 -0400 |
commit | d99c4022f60a9aa3a8dc6b7d71f3d0998c696912 (patch) | |
tree | d02de9d131b3d45a21ce60e4b5d3380497f86daf /include/asm-um | |
parent | 4413a511f22ec771edc0b7c93e5b34e05511acb5 (diff) |
[PATCH] uml: inline mk_pte and various friends
Turns out that, for UML, a *lot* of VM-related trivial functions are not
inlined but rather normal functions.
In other sections of UML code, this is justified by having files which
interact with the host and cannot therefore include kernel headers, but in
this case there's no such justification.
I've had to turn many of them to macros because of missing declarations. While
doing this, I've decided to reuse some already existing macros.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-um')
-rw-r--r-- | include/asm-um/page.h | 3 | ||||
-rw-r--r-- | include/asm-um/pgtable.h | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index bd850a249183..2c192abe9aeb 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h | |||
@@ -96,8 +96,7 @@ extern unsigned long uml_physmem; | |||
96 | 96 | ||
97 | #define __va_space (8*1024*1024) | 97 | #define __va_space (8*1024*1024) |
98 | 98 | ||
99 | extern unsigned long to_phys(void *virt); | 99 | #include "mem.h" |
100 | extern void *to_virt(unsigned long phys); | ||
101 | 100 | ||
102 | /* Cast to unsigned long before casting to void * to avoid a warning from | 101 | /* Cast to unsigned long before casting to void * to avoid a warning from |
103 | * mmap_kmem about cutting a long long down to a void *. Not sure that | 102 | * mmap_kmem about cutting a long long down to a void *. Not sure that |
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index b48e0966ecd7..ed06170e0edd 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h | |||
@@ -326,14 +326,22 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval) | |||
326 | } | 326 | } |
327 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 327 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) |
328 | 328 | ||
329 | extern phys_t page_to_phys(struct page *page); | ||
330 | |||
331 | /* | 329 | /* |
332 | * Conversion functions: convert a page and protection to a page entry, | 330 | * Conversion functions: convert a page and protection to a page entry, |
333 | * and a page entry and page directory to the page they refer to. | 331 | * and a page entry and page directory to the page they refer to. |
334 | */ | 332 | */ |
335 | 333 | ||
336 | extern pte_t mk_pte(struct page *page, pgprot_t pgprot); | 334 | #define phys_to_page(phys) pfn_to_page(phys_to_pfn(phys)) |
335 | #define __virt_to_page(virt) phys_to_page(__pa(virt)) | ||
336 | #define page_to_phys(page) pfn_to_phys(page_to_pfn(page)) | ||
337 | |||
338 | #define mk_pte(page, pgprot) \ | ||
339 | ({ pte_t pte; \ | ||
340 | \ | ||
341 | pte_set_val(pte, page_to_phys(page), (pgprot)); \ | ||
342 | if (pte_present(pte)) \ | ||
343 | pte_mknewprot(pte_mknewpage(pte)); \ | ||
344 | pte;}) | ||
337 | 345 | ||
338 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 346 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
339 | { | 347 | { |
@@ -410,8 +418,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
410 | #endif | 418 | #endif |
411 | #endif | 419 | #endif |
412 | 420 | ||
413 | extern struct page *phys_to_page(const unsigned long phys); | ||
414 | extern struct page *__virt_to_page(const unsigned long virt); | ||
415 | #define virt_to_page(addr) __virt_to_page((const unsigned long) addr) | 421 | #define virt_to_page(addr) __virt_to_page((const unsigned long) addr) |
416 | 422 | ||
417 | /* | 423 | /* |