Changeset 37947 in vbox for trunk/src/VBox/Runtime/r0drv/solaris
- Timestamp:
- Jul 14, 2011 9:50:29 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/i86pc/os/vbi.c
r37281 r37947 78 78 /* Introduced in v9 */ 79 79 static int use_kflt = 0; 80 static page_t *vbi_page_get_fromlist(uint_t freelist, caddr_t virtAddr );80 static page_t *vbi_page_get_fromlist(uint_t freelist, caddr_t virtAddr, size_t pgsize); 81 81 82 82 … … 161 161 /* kthread_t */ 162 162 static int off_s11_t_preempt = 42; 163 164 /* 64-bit Solaris 11 snv_166+ offsets (CR 7037143) */ 165 static int off_s11_t_preempt_new = 48; 163 166 #else 164 167 /* 32-bit Solaris 10 offsets */ … … 280 283 off_cpu_kprunrun = off_s11_cpu_kprunrun; 281 284 off_t_preempt = off_s11_t_preempt; 285 286 #ifdef _LP64 287 /* Only 64-bit kernels */ 288 long snv_version = 0; 289 if (!strncmp(utsname.version, "snv_", 4)) 290 { 291 ddi_strtol(utsname.version + 4, NULL /* endptr */, 0, &snv_version); 292 if (snv_version >= 166) 293 { 294 off_t_preempt = off_s11_t_preempt_new; 295 cmn_err(CE_NOTE, "here\n"); 296 } 297 298 cmn_err(CE_NOTE, "Detected S11 version %ld: Preemption offset=%d\n", snv_version, off_t_preempt); 299 } 300 else 301 cmn_err(CE_NOTE, "WARNING!! Cannot determine version. Assuming pre snv_166. Preemption offset=%ld may be busted!\n", off_t_preempt); 302 #endif 282 303 } else { 283 304 /* Solaris 10 detected... */ … … 1333 1354 { 1334 1355 /* get a page from the freelists */ 1335 page_t *ppage = vbi_page_get_fromlist(1 /* freelist */, virtAddr );1356 page_t *ppage = vbi_page_get_fromlist(1 /* freelist */, virtAddr, PAGESIZE); 1336 1357 if (!ppage) 1337 1358 { 1338 1359 /* try from the cachelists */ 1339 ppage = vbi_page_get_fromlist(2 /* cachelist */, virtAddr );1360 ppage = vbi_page_get_fromlist(2 /* cachelist */, virtAddr, PAGESIZE); 1340 1361 if (!ppage) 1341 1362 { … … 1434 1455 1435 1456 1436 1437 static page_t *vbi_page_get_fromlist(uint_t freelist, caddr_t virtAddr) 1438 { 1457 static page_t * 1458 vbi_page_get_fromlist(uint_t freelist, caddr_t virtAddr, size_t pgsize) 1459 { 1460 /* pgsize only applies when using the freelist */ 1439 1461 seg_t kernseg; 1440 1462 kernseg.s_as = &kas; … … 1443 1465 { 1444 1466 ppage = page_get_freelist(&vbipagevp, 0 /* offset */, &kernseg, virtAddr, 1445 PAGESIZE, 0 /* flags */, NULL /* local group */);1446 if (!ppage )1467 pgsize, 0 /* flags */, NULL /* local group */); 1468 if (!ppage && use_kflt) 1447 1469 { 1448 if (use_kflt) 1449 { 1450 ppage = page_get_freelist(&vbipagevp, 0 /* offset */, &kernseg, virtAddr, 1451 PAGESIZE, 0x0200 /* PG_KFLT */, NULL /* local group */); 1452 } 1470 ppage = page_get_freelist(&vbipagevp, 0 /* offset */, &kernseg, virtAddr, 1471 pgsize, 0x0200 /* PG_KFLT */, NULL /* local group */); 1453 1472 } 1454 1473 } … … 1458 1477 ppage = page_get_cachelist(&vbipagevp, 0 /* offset */, &kernseg, virtAddr, 1459 1478 0 /* flags */, NULL /* local group */); 1460 if (!ppage )1479 if (!ppage && use_kflt) 1461 1480 { 1462 if (use_kflt) 1463 { 1464 ppage = page_get_cachelist(&vbipagevp, 0 /* offset */, &kernseg, virtAddr, 1465 0x0200 /* PG_KFLT */, NULL /* local group */); 1466 } 1481 ppage = page_get_cachelist(&vbipagevp, 0 /* offset */, &kernseg, virtAddr, 1482 0x0200 /* PG_KFLT */, NULL /* local group */); 1467 1483 } 1468 1484 } … … 1489 1505 */ 1490 1506 rc = page_resv(npages, KM_NOSLEEP); 1491 if (!rc) {1507 if (!rc) 1492 1508 return NULL; 1493 } 1509 1494 1510 rc = page_create_wait(npages, 0 /* flags */); 1495 1511 if (!rc) { … … 1504 1520 vaddr = NULL; 1505 1521 kernseg.s_as = &kas; 1506 pproot = page_get_freelist(&vbipagevp, 0 /* offset */, &kernseg, 1507 vaddr, pgsize, 0x0000 /* flags */, NULL /*lgrp*/); 1508 if (!pproot && use_kflt) { 1509 pproot = page_get_freelist(&vbipagevp, 0 /* offset */, &kernseg, 1510 vaddr, pgsize, 0x0200 /* PG_KFLT */, NULL /*lgrp*/); 1511 if (!pproot) { 1512 page_create_putback(npages); 1513 page_unresv(npages); 1514 return NULL; 1515 } 1522 pproot = vbi_page_get_fromlist(1 /* freelist */, vaddr, pgsize); 1523 if (!pproot) 1524 { 1525 page_create_putback(npages); 1526 page_unresv(npages); 1527 return NULL; 1516 1528 } 1517 1529 AssertMsg(!(page_pptonum(pproot) & (npages - 1)), ("%p:%lx npages=%lx\n", pproot, page_pptonum(pproot), npages));
Note:
See TracChangeset
for help on using the changeset viewer.