FreeBSD/sys/x86/acpica/srat.c
/*
 * Check that the SRAT memory regions cover all of the regions in
 * phys_avail[].
 */
Check that the SRAT memory regions cover all of the regions in
phys_avail[].
Check that the SRAT memory regions cover all of the regions in phys_avail [] .
static int
check_phys_avail(void)
{
	vm_paddr_t address;
	int i, j;
	address = phys_avail[0];
	j = 0;
	for (i = 0; i < num_mem; i++) {
		while (address >= mem_info[i].start &&
		    address <= mem_info[i].end) {
			if (phys_avail[j + 1] <= mem_info[i].end) {
				j += 2;
				if (phys_avail[j] == 0 &&
				    phys_avail[j + 1] == 0) {
					return (0);
				}
				address = phys_avail[j];
			} else
				address = mem_info[i].end + 1;
		}
	}
	printf("SRAT: No memory region found for %jx - %jx\n",
	    (uintmax_t)phys_avail[j], (uintmax_t)phys_avail[j + 1]);
	return (ENXIO);
}
static int check_phys_avail ( void ) { vm_paddr_t address ; int i , j ; address = phys_avail [ 0 ] ; j = 0 ; for ( i = 0 ; i < num_mem ; i ++ ) { while ( address >= mem_info [ i ] . start && address <= mem_info [ i ] . end ) { if ( phys_avail [ j + 1 ] <= mem_info [ i ] . end ) { j += 2 ; if ( phys_avail [ j ] == 0 && phys_avail [ j + 1 ] == 0 ) { return ( 0 ) ; } address = phys_avail [ j ] ; } else address = mem_info [ i ] . end + 1 ; } } printf ( " \n " , ( uintmax_t ) phys_avail [ j ] , ( uintmax_t ) phys_avail [ j + 1 ] ) ; return ( ENXIO ) ; }
Check that the SRAT memory regions cover all of the regions in
 phys_avail[].
Check that the SRAT memory regions cover all of the regions in phys_avail [] .
/* j is the current offset into phys_avail[]. */ /*
		 * Consume as many phys_avail[] entries as fit in this
		 * region.
		 */ /*
			 * If we cover the rest of this phys_avail[] entry,
			 * advance to the next entry.
			 */