/* Return index of the last available xpram page.  */
static unsigned long xpram_highest_page_index(void)
/* Return index of the last available xpram page.  */
static unsigned long xpram_highest_page_index(void)
{
	unsigned int page_index, add_bit;
	unsigned long mem_page;
	mem_page = (unsigned long) __get_free_page(GFP_KERNEL);
	if (!mem_page)
		return 0;
	page_index = 0;
	add_bit = 1ULL << (sizeof(unsigned int)*8 - 1);
	while (add_bit > 0) {
		if (xpram_page_in(mem_page, page_index | add_bit) == 0)
			page_index |= add_bit;
		add_bit >>= 1;
	}
	free_page (mem_page);
	return page_index;
}