Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113514
b: refs/heads/master
c: 1494177
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Oct 13, 2008
1 parent 2851484 commit 42c4568
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: efc9eb20b2f5125642fc37a1dbabadc3ce5d321c
refs/heads/master: 1494177942b23b7094ca291d37e6f6263fa60fdd
2 changes: 1 addition & 1 deletion trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static __ref void *alloc_low_page(unsigned long *phys)
if (pfn >= table_top)
panic("alloc_low_page: ran out of memory");

adr = early_ioremap(pfn * PAGE_SIZE, PAGE_SIZE);
adr = early_memremap(pfn * PAGE_SIZE, PAGE_SIZE);
memset(adr, 0, PAGE_SIZE);
*phys = pfn * PAGE_SIZE;
return adr;
Expand Down
22 changes: 17 additions & 5 deletions trunk/arch/x86/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,12 +568,12 @@ static void __init __early_set_fixmap(enum fixed_addresses idx,
}

static inline void __init early_set_fixmap(enum fixed_addresses idx,
unsigned long phys)
unsigned long phys, pgprot_t prot)
{
if (after_paging_init)
set_fixmap(idx, phys);
__set_fixmap(idx, phys, prot);
else
__early_set_fixmap(idx, phys, PAGE_KERNEL);
__early_set_fixmap(idx, phys, prot);
}

static inline void __init early_clear_fixmap(enum fixed_addresses idx)
Expand Down Expand Up @@ -601,7 +601,7 @@ static int __init check_early_ioremap_leak(void)
}
late_initcall(check_early_ioremap_leak);

void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
static void __init *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot)
{
unsigned long offset, last_addr;
unsigned int nrpages, nesting;
Expand Down Expand Up @@ -650,7 +650,7 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
idx0 = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*nesting;
idx = idx0;
while (nrpages > 0) {
early_set_fixmap(idx, phys_addr);
early_set_fixmap(idx, phys_addr, prot);
phys_addr += PAGE_SIZE;
--idx;
--nrpages;
Expand All @@ -661,6 +661,18 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
return (void *) (offset + fix_to_virt(idx0));
}

/* Remap an IO device */
void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
{
return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO);
}

/* Remap memory */
void __init *early_memremap(unsigned long phys_addr, unsigned long size)
{
return __early_ioremap(phys_addr, size, PAGE_KERNEL);
}

void __init early_iounmap(void *addr, unsigned long size)
{
unsigned long virt_addr;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ extern void early_ioremap_init(void);
extern void early_ioremap_clear(void);
extern void early_ioremap_reset(void);
extern void *early_ioremap(unsigned long offset, unsigned long size);
extern void *early_memremap(unsigned long offset, unsigned long size);
extern void early_iounmap(void *addr, unsigned long size);
extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);

Expand Down

0 comments on commit 42c4568

Please sign in to comment.