srat.c (876d357fa7bc8aeb8d050dd8fe227dd4fd8ed4df) srat.c (3765b809934386dda7010960d5494fcb77dd0a8a)
1/*-
2 * Copyright (c) 2010 Hudson River Trading LLC
3 * Written by: John H. Baldwin <jhb@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 341 unchanged lines hidden (view full) ---

350 /* See if this domain is already known. */
351 for (j = 0; j < ndomain; j++) {
352 if (domain_pxm[j] >= mem_info[i].domain)
353 break;
354 }
355 if (j < ndomain && domain_pxm[j] == mem_info[i].domain)
356 continue;
357
1/*-
2 * Copyright (c) 2010 Hudson River Trading LLC
3 * Written by: John H. Baldwin <jhb@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 341 unchanged lines hidden (view full) ---

350 /* See if this domain is already known. */
351 for (j = 0; j < ndomain; j++) {
352 if (domain_pxm[j] >= mem_info[i].domain)
353 break;
354 }
355 if (j < ndomain && domain_pxm[j] == mem_info[i].domain)
356 continue;
357
358 if (ndomain >= MAXMEMDOM) {
359 ndomain = 1;
360 printf("SRAT: Too many memory domains\n");
361 return (EFBIG);
362 }
363
358 /* Insert the new domain at slot 'j'. */
359 slot = j;
360 for (j = ndomain; j > slot; j--)
361 domain_pxm[j] = domain_pxm[j - 1];
362 domain_pxm[slot] = mem_info[i].domain;
363 ndomain++;
364 /* Insert the new domain at slot 'j'. */
365 slot = j;
366 for (j = ndomain; j > slot; j--)
367 domain_pxm[j] = domain_pxm[j - 1];
368 domain_pxm[slot] = mem_info[i].domain;
369 ndomain++;
364 if (ndomain > MAXMEMDOM) {
365 ndomain = 1;
366 printf("SRAT: Too many memory domains\n");
367 return (EFBIG);
368 }
369 }
370
371 /* Renumber each domain to its index in the sorted 'domain_pxm' list. */
372 for (i = 0; i < ndomain; i++) {
373 /*
374 * If the domain is already the right value, no need
375 * to renumber.
376 */

--- 145 unchanged lines hidden ---
370 }
371
372 /* Renumber each domain to its index in the sorted 'domain_pxm' list. */
373 for (i = 0; i < ndomain; i++) {
374 /*
375 * If the domain is already the right value, no need
376 * to renumber.
377 */

--- 145 unchanged lines hidden ---