Commit 59b71440 authored by Josh Kunz's avatar Josh Kunz

Fixes most compiler warnings

parent 6ec51552
......@@ -8,7 +8,8 @@
AR = ar
CC = cc
CFLAGS = -I./include
_unused = -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter
CFLAGS = -I./include -Wall -Wextra -Werror $(_unused)
headers = $(wildcard include/*)
sources = $(wildcard src/*)
......
......@@ -310,7 +310,7 @@ static int find_cnode(struct cspace *cspace, struct cnode_table *old,
}
}
static int get_level_index(int table_level, cptr_t c,
static int get_level_index(unsigned long table_level, cptr_t c,
unsigned long *level_id)
{
/*
......@@ -505,53 +505,53 @@ int __lcd_cap_insert(struct cspace *cspace, cptr_t c, void *object,
static void free_cnode_object(struct cspace *cspace, struct cnode *cnode)
{
return;
/* struct lcd *lcd;
switch (cnode->type) {
case LCD_CAP_TYPE_SYNC_EP:
/*
* No lcd's should be in endpoint's queues. Safe to delete it.
*/
/* __lcd_sync_endpoint_destroy(cnode->object);
break;
case LCD_CAP_TYPE_PAGE:
/*
* No lcd's should have page mapped. Safe to delete it.
*/
/* __lcd_page_destroy(cnode->object);
break;
case LCD_CAP_TYPE_KPAGE:
/*
* No lcd's should have page mapped
*/
/* __lcd_kpage_destroy(cnode->object);
break;
case LCD_CAP_TYPE_LCD:
/*
* No lcd's have capability to the lcd. Safe to tear it down.
*
* SPECIAL CASE: If the lcd deleting the last capability is the
* lcd itself, we need to release the lock on the lcd cnode
* so that the lcd can tear down its own cspace. This call
* will not return (the kthread will stop and exit).
*/
/* lcd = cnode->object; /* being paranoid to avoid NULL deref in
* case the calling lcd is the same as the
* lcd to be deleted
*/
//if (unlikely(cspace_to_lcd(cspace) == current->lcd)) {
/* if (unlikely(cspace_to_lcd(cspace) == lcd)) {
cnode->type = LCD_CAP_TYPE_FREE;
__lcd_cnode_put(cnode);
}
__lcd_destroy(lcd);
break;
default:
/* we don't expect to see invalid, free, or cnode types here */
/* LCD_ERR("unexpected cnode type %d", cnode->type);
//BUG();
printf("This is BUG\n");
break;
}*/
// struct lcd *lcd;
// switch (cnode->type) {
// case LCD_CAP_TYPE_SYNC_EP:
// /*
// * No lcd's should be in endpoint's queues. Safe to delete it.
// */
// __lcd_sync_endpoint_destroy(cnode->object);
// break;
// case LCD_CAP_TYPE_PAGE:
// /*
// * No lcd's should have page mapped. Safe to delete it.
// */
// __lcd_page_destroy(cnode->object);
// break;
// case LCD_CAP_TYPE_KPAGE:
// /*
// * No lcd's should have page mapped
// */
// __lcd_kpage_destroy(cnode->object);
// break;
// case LCD_CAP_TYPE_LCD:
// /*
// * No lcd's have capability to the lcd. Safe to tear it down.
// *
// * SPECIAL CASE: If the lcd deleting the last capability is the
// * lcd itself, we need to release the lock on the lcd cnode
// * so that the lcd can tear down its own cspace. This call
// * will not return (the kthread will stop and exit).
// */
// lcd = cnode->object; /* being paranoid to avoid NULL deref in
// * case the calling lcd is the same as the
// * lcd to be deleted
// */
// //if (unlikely(cspace_to_lcd(cspace) == current->lcd)) {
// if (unlikely(cspace_to_lcd(cspace) == lcd)) {
// cnode->type = LCD_CAP_TYPE_FREE;
// __lcd_cnode_put(cnode);
// }
// __lcd_destroy(lcd);
// break;
// default:
// /* we don't expect to see invalid, free, or cnode types here */
// LCD_ERR("unexpected cnode type %d", cnode->type);
// //BUG();
// printf("This is BUG\n");
// break;
// }
}
/* Kept the dummy, Will be removing subsequently */
......
......@@ -165,7 +165,7 @@ static void cptr_cache_destroy(struct cptr_cache *cache)
#endif
}
int __lcd_alloc_cptr_from_bmap(unsigned long *bmap, int size,
int __lcd_alloc_cptr_from_bmap(unsigned long *bmap, unsigned long size,
unsigned long *out)
{
unsigned long idx;
......
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