Commit a23281d2 authored by Abhiram Balasubramanian's avatar Abhiram Balasubramanian Committed by Vikram Narayanan
Browse files

Fix build errors


Signed-off-by: Abhiram Balasubramanian's avatarAbhiram Balasubramanian <abhiram@cs.utah.edu>
parent abf9f496
...@@ -55,13 +55,14 @@ int _lcd_ioremap(cptr_t phys_addr, unsigned int size, gpa_t *base) { ...@@ -55,13 +55,14 @@ int _lcd_ioremap(cptr_t phys_addr, unsigned int size, gpa_t *base) {
goto exit_mmap; goto exit_mmap;
} }
ret = __liblcd_mem_itree_insert(base, (1UL << (PAGE_SHIFT + order)), ret = __liblcd_mem_itree_insert(addr, (1UL << (PAGE_SHIFT + order)),
phys_addr); phys_addr);
if (ret) { if (ret) {
LIBLCD_ERR("error inserting into mem itree"); LIBLCD_ERR("error inserting into mem itree");
goto exit_itree_insert; goto exit_itree_insert;
} }
*base = addr;
return ret; return ret;
exit_itree_insert: exit_itree_insert:
...@@ -79,6 +80,7 @@ void _lcd_iounmap(gpa_t phys_addr, unsigned long size) ...@@ -79,6 +80,7 @@ void _lcd_iounmap(gpa_t phys_addr, unsigned long size)
int ret; int ret;
struct lcd_resource_node *n; struct lcd_resource_node *n;
unsigned int order = 0; unsigned int order = 0;
cptr_t phys;
order = ilog2(size >> PAGE_SHIFT); order = ilog2(size >> PAGE_SHIFT);
...@@ -91,14 +93,16 @@ void _lcd_iounmap(gpa_t phys_addr, unsigned long size) ...@@ -91,14 +93,16 @@ void _lcd_iounmap(gpa_t phys_addr, unsigned long size)
return; return;
} }
phys = n->cptr;
lcd_page_allocator_free( lcd_page_allocator_free(
ioremapmap_allocator, ioremap_allocator,
ioremap_addr_to_page_block(phys_addr), ioremap_addr_to_page_block(phys_addr),
order); order);
__liblcd_mem_itree_delete(n); __liblcd_mem_itree_delete(n);
lcd_syscall_munmap(phys_addr); lcd_syscall_munmap(phys);
} }
static int static int
...@@ -113,14 +117,13 @@ alloc_ioremap_metadata_memory(const struct lcd_page_allocator_cbs *cbs, ...@@ -113,14 +117,13 @@ alloc_ioremap_metadata_memory(const struct lcd_page_allocator_cbs *cbs,
if (!*metadata_addr) { if (!*metadata_addr) {
LIBLCD_ERR("error getting metadata mem for ioremap"); LIBLCD_ERR("error getting metadata mem for ioremap");
ret = -ENOMEM; ret = -ENOMEM;
goto exit;
} }
return ret; return ret;
} }
static void static void
ram_free_unmap_metadata_memory(const struct lcd_page_allocator_cbs *cbs, free_ioremap_metadata_memory(const struct lcd_page_allocator_cbs *cbs,
void *metadata_addr, void *metadata_addr,
unsigned long metadata_sz, unsigned long metadata_sz,
unsigned int alloc_order) unsigned int alloc_order)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment