add memory allocation check
This commit is contained in:
@@ -22,6 +22,9 @@ enum ihk_mc_ma_type {
|
||||
|
||||
enum ihk_mc_ap_flag {
|
||||
IHK_MC_AP_FLAG,
|
||||
IHK_MC_AP_CRITICAL, /* panic on no memory space */
|
||||
IHK_MC_AP_NOWAIT, /* error return on no memory space */
|
||||
IHK_MC_AP_WAIT /* wait on no memory space */
|
||||
};
|
||||
|
||||
enum ihk_mc_pt_prepare_flag {
|
||||
@@ -91,7 +94,7 @@ int ihk_mc_pt_clear_page(page_table_t pt, void *virt);
|
||||
int ihk_mc_pt_prepare_map(page_table_t pt, void *virt, unsigned long size,
|
||||
enum ihk_mc_pt_prepare_flag);
|
||||
|
||||
struct page_table *ihk_mc_pt_create(void);
|
||||
struct page_table *ihk_mc_pt_create(enum ihk_mc_ap_flag ap_flag);
|
||||
void ihk_mc_load_page_table(struct page_table *pt);
|
||||
int ihk_mc_pt_virt_to_phys(struct page_table *pt,
|
||||
void *virt, unsigned long *phys);
|
||||
|
||||
@@ -44,7 +44,7 @@ void *__ihk_pagealloc_init(unsigned long start, unsigned long size,
|
||||
desc = initial;
|
||||
*pdescsize = descsize;
|
||||
} else {
|
||||
desc = (void *)allocate_pages(descsize, 0);
|
||||
desc = (void *)allocate_pages(descsize, IHK_MC_AP_CRITICAL);
|
||||
}
|
||||
if (!desc) {
|
||||
kprintf("IHK: failed to allocate page-allocator-desc "\
|
||||
|
||||
Reference in New Issue
Block a user