/* Take this opportunity to round the start address up and the end address down to page boundaries.  */
void call_pernode_memory(unsigned long start, unsigned long len, void *arg)
/* Take this opportunity to round the start address up and the end address down to page boundaries.  */
void call_pernode_memory(unsigned long start, unsigned long len, void *arg)
{
	unsigned long rs, re, end = start + len;
	void (*func)(unsigned long, unsigned long, int);
	int i;
	start = PAGE_ALIGN(start);
	end &= PAGE_MASK;
	if (start >= end)
		return;
	func = arg;
	if (!num_node_memblks) {
		if (start < end)
			(*func)(start, end - start, 0);
		return;
	}
	for (i = 0; i < num_node_memblks; i++) {
		rs = max(start, node_memblk[i].start_paddr);
		re = min(end, node_memblk[i].start_paddr +
			 node_memblk[i].size);
		if (rs < re)
			(*func)(rs, re - rs, node_memblk[i].nid);
		if (re == end)
			break;
	}
}