diff options
author | Dave Airlie <airlied@redhat.com> | 2015-12-07 20:04:26 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-12-07 20:04:26 -0500 |
commit | e876b41ab074561d65f213bf5e0fc68cf5bc7380 (patch) | |
tree | 5bcbd7e4f7b6ac2a34e61011f8eb2cde90bf8603 /tools | |
parent | 47c0fd72822159eb501411f975f5672a0bf7a7fb (diff) | |
parent | 527e9316f8ec44bd53d90fb9f611fa7ffff52bb9 (diff) |
Back merge tag 'v4.4-rc4' into drm-next
We've picked up a few conflicts and it would be nice
to resolve them before we move onwards.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/nvdimm/test/nfit.c | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index 40ab4476c80a..51cf8256c6cd 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c | |||
@@ -420,8 +420,7 @@ static struct nfit_test_resource *nfit_test_lookup(resource_size_t addr) | |||
420 | 420 | ||
421 | static int nfit_test0_alloc(struct nfit_test *t) | 421 | static int nfit_test0_alloc(struct nfit_test *t) |
422 | { | 422 | { |
423 | size_t nfit_size = sizeof(struct acpi_table_nfit) | 423 | size_t nfit_size = sizeof(struct acpi_nfit_system_address) * NUM_SPA |
424 | + sizeof(struct acpi_nfit_system_address) * NUM_SPA | ||
425 | + sizeof(struct acpi_nfit_memory_map) * NUM_MEM | 424 | + sizeof(struct acpi_nfit_memory_map) * NUM_MEM |
426 | + sizeof(struct acpi_nfit_control_region) * NUM_DCR | 425 | + sizeof(struct acpi_nfit_control_region) * NUM_DCR |
427 | + sizeof(struct acpi_nfit_data_region) * NUM_BDW | 426 | + sizeof(struct acpi_nfit_data_region) * NUM_BDW |
@@ -471,8 +470,7 @@ static int nfit_test0_alloc(struct nfit_test *t) | |||
471 | 470 | ||
472 | static int nfit_test1_alloc(struct nfit_test *t) | 471 | static int nfit_test1_alloc(struct nfit_test *t) |
473 | { | 472 | { |
474 | size_t nfit_size = sizeof(struct acpi_table_nfit) | 473 | size_t nfit_size = sizeof(struct acpi_nfit_system_address) |
475 | + sizeof(struct acpi_nfit_system_address) | ||
476 | + sizeof(struct acpi_nfit_memory_map) | 474 | + sizeof(struct acpi_nfit_memory_map) |
477 | + sizeof(struct acpi_nfit_control_region); | 475 | + sizeof(struct acpi_nfit_control_region); |
478 | 476 | ||
@@ -488,39 +486,24 @@ static int nfit_test1_alloc(struct nfit_test *t) | |||
488 | return 0; | 486 | return 0; |
489 | } | 487 | } |
490 | 488 | ||
491 | static void nfit_test_init_header(struct acpi_table_nfit *nfit, size_t size) | ||
492 | { | ||
493 | memcpy(nfit->header.signature, ACPI_SIG_NFIT, 4); | ||
494 | nfit->header.length = size; | ||
495 | nfit->header.revision = 1; | ||
496 | memcpy(nfit->header.oem_id, "LIBND", 6); | ||
497 | memcpy(nfit->header.oem_table_id, "TEST", 5); | ||
498 | nfit->header.oem_revision = 1; | ||
499 | memcpy(nfit->header.asl_compiler_id, "TST", 4); | ||
500 | nfit->header.asl_compiler_revision = 1; | ||
501 | } | ||
502 | |||
503 | static void nfit_test0_setup(struct nfit_test *t) | 489 | static void nfit_test0_setup(struct nfit_test *t) |
504 | { | 490 | { |
505 | struct nvdimm_bus_descriptor *nd_desc; | 491 | struct nvdimm_bus_descriptor *nd_desc; |
506 | struct acpi_nfit_desc *acpi_desc; | 492 | struct acpi_nfit_desc *acpi_desc; |
507 | struct acpi_nfit_memory_map *memdev; | 493 | struct acpi_nfit_memory_map *memdev; |
508 | void *nfit_buf = t->nfit_buf; | 494 | void *nfit_buf = t->nfit_buf; |
509 | size_t size = t->nfit_size; | ||
510 | struct acpi_nfit_system_address *spa; | 495 | struct acpi_nfit_system_address *spa; |
511 | struct acpi_nfit_control_region *dcr; | 496 | struct acpi_nfit_control_region *dcr; |
512 | struct acpi_nfit_data_region *bdw; | 497 | struct acpi_nfit_data_region *bdw; |
513 | struct acpi_nfit_flush_address *flush; | 498 | struct acpi_nfit_flush_address *flush; |
514 | unsigned int offset; | 499 | unsigned int offset; |
515 | 500 | ||
516 | nfit_test_init_header(nfit_buf, size); | ||
517 | |||
518 | /* | 501 | /* |
519 | * spa0 (interleave first half of dimm0 and dimm1, note storage | 502 | * spa0 (interleave first half of dimm0 and dimm1, note storage |
520 | * does not actually alias the related block-data-window | 503 | * does not actually alias the related block-data-window |
521 | * regions) | 504 | * regions) |
522 | */ | 505 | */ |
523 | spa = nfit_buf + sizeof(struct acpi_table_nfit); | 506 | spa = nfit_buf; |
524 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 507 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
525 | spa->header.length = sizeof(*spa); | 508 | spa->header.length = sizeof(*spa); |
526 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16); | 509 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16); |
@@ -533,7 +516,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
533 | * does not actually alias the related block-data-window | 516 | * does not actually alias the related block-data-window |
534 | * regions) | 517 | * regions) |
535 | */ | 518 | */ |
536 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa); | 519 | spa = nfit_buf + sizeof(*spa); |
537 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 520 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
538 | spa->header.length = sizeof(*spa); | 521 | spa->header.length = sizeof(*spa); |
539 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16); | 522 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16); |
@@ -542,7 +525,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
542 | spa->length = SPA1_SIZE; | 525 | spa->length = SPA1_SIZE; |
543 | 526 | ||
544 | /* spa2 (dcr0) dimm0 */ | 527 | /* spa2 (dcr0) dimm0 */ |
545 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa) * 2; | 528 | spa = nfit_buf + sizeof(*spa) * 2; |
546 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 529 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
547 | spa->header.length = sizeof(*spa); | 530 | spa->header.length = sizeof(*spa); |
548 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); | 531 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); |
@@ -551,7 +534,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
551 | spa->length = DCR_SIZE; | 534 | spa->length = DCR_SIZE; |
552 | 535 | ||
553 | /* spa3 (dcr1) dimm1 */ | 536 | /* spa3 (dcr1) dimm1 */ |
554 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa) * 3; | 537 | spa = nfit_buf + sizeof(*spa) * 3; |
555 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 538 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
556 | spa->header.length = sizeof(*spa); | 539 | spa->header.length = sizeof(*spa); |
557 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); | 540 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); |
@@ -560,7 +543,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
560 | spa->length = DCR_SIZE; | 543 | spa->length = DCR_SIZE; |
561 | 544 | ||
562 | /* spa4 (dcr2) dimm2 */ | 545 | /* spa4 (dcr2) dimm2 */ |
563 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa) * 4; | 546 | spa = nfit_buf + sizeof(*spa) * 4; |
564 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 547 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
565 | spa->header.length = sizeof(*spa); | 548 | spa->header.length = sizeof(*spa); |
566 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); | 549 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); |
@@ -569,7 +552,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
569 | spa->length = DCR_SIZE; | 552 | spa->length = DCR_SIZE; |
570 | 553 | ||
571 | /* spa5 (dcr3) dimm3 */ | 554 | /* spa5 (dcr3) dimm3 */ |
572 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa) * 5; | 555 | spa = nfit_buf + sizeof(*spa) * 5; |
573 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 556 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
574 | spa->header.length = sizeof(*spa); | 557 | spa->header.length = sizeof(*spa); |
575 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); | 558 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16); |
@@ -578,7 +561,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
578 | spa->length = DCR_SIZE; | 561 | spa->length = DCR_SIZE; |
579 | 562 | ||
580 | /* spa6 (bdw for dcr0) dimm0 */ | 563 | /* spa6 (bdw for dcr0) dimm0 */ |
581 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa) * 6; | 564 | spa = nfit_buf + sizeof(*spa) * 6; |
582 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 565 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
583 | spa->header.length = sizeof(*spa); | 566 | spa->header.length = sizeof(*spa); |
584 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); | 567 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); |
@@ -587,7 +570,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
587 | spa->length = DIMM_SIZE; | 570 | spa->length = DIMM_SIZE; |
588 | 571 | ||
589 | /* spa7 (bdw for dcr1) dimm1 */ | 572 | /* spa7 (bdw for dcr1) dimm1 */ |
590 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa) * 7; | 573 | spa = nfit_buf + sizeof(*spa) * 7; |
591 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 574 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
592 | spa->header.length = sizeof(*spa); | 575 | spa->header.length = sizeof(*spa); |
593 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); | 576 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); |
@@ -596,7 +579,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
596 | spa->length = DIMM_SIZE; | 579 | spa->length = DIMM_SIZE; |
597 | 580 | ||
598 | /* spa8 (bdw for dcr2) dimm2 */ | 581 | /* spa8 (bdw for dcr2) dimm2 */ |
599 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa) * 8; | 582 | spa = nfit_buf + sizeof(*spa) * 8; |
600 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 583 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
601 | spa->header.length = sizeof(*spa); | 584 | spa->header.length = sizeof(*spa); |
602 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); | 585 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); |
@@ -605,7 +588,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
605 | spa->length = DIMM_SIZE; | 588 | spa->length = DIMM_SIZE; |
606 | 589 | ||
607 | /* spa9 (bdw for dcr3) dimm3 */ | 590 | /* spa9 (bdw for dcr3) dimm3 */ |
608 | spa = nfit_buf + sizeof(struct acpi_table_nfit) + sizeof(*spa) * 9; | 591 | spa = nfit_buf + sizeof(*spa) * 9; |
609 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 592 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |
610 | spa->header.length = sizeof(*spa); | 593 | spa->header.length = sizeof(*spa); |
611 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); | 594 | memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16); |
@@ -613,7 +596,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
613 | spa->address = t->dimm_dma[3]; | 596 | spa->address = t->dimm_dma[3]; |
614 | spa->length = DIMM_SIZE; | 597 | spa->length = DIMM_SIZE; |
615 | 598 | ||
616 | offset = sizeof(struct acpi_table_nfit) + sizeof(*spa) * 10; | 599 | offset = sizeof(*spa) * 10; |
617 | /* mem-region0 (spa0, dimm0) */ | 600 | /* mem-region0 (spa0, dimm0) */ |
618 | memdev = nfit_buf + offset; | 601 | memdev = nfit_buf + offset; |
619 | memdev->header.type = ACPI_NFIT_TYPE_MEMORY_MAP; | 602 | memdev->header.type = ACPI_NFIT_TYPE_MEMORY_MAP; |
@@ -1100,15 +1083,13 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
1100 | 1083 | ||
1101 | static void nfit_test1_setup(struct nfit_test *t) | 1084 | static void nfit_test1_setup(struct nfit_test *t) |
1102 | { | 1085 | { |
1103 | size_t size = t->nfit_size, offset; | 1086 | size_t offset; |
1104 | void *nfit_buf = t->nfit_buf; | 1087 | void *nfit_buf = t->nfit_buf; |
1105 | struct acpi_nfit_memory_map *memdev; | 1088 | struct acpi_nfit_memory_map *memdev; |
1106 | struct acpi_nfit_control_region *dcr; | 1089 | struct acpi_nfit_control_region *dcr; |
1107 | struct acpi_nfit_system_address *spa; | 1090 | struct acpi_nfit_system_address *spa; |
1108 | 1091 | ||
1109 | nfit_test_init_header(nfit_buf, size); | 1092 | offset = 0; |
1110 | |||
1111 | offset = sizeof(struct acpi_table_nfit); | ||
1112 | /* spa0 (flat range with no bdw aliasing) */ | 1093 | /* spa0 (flat range with no bdw aliasing) */ |
1113 | spa = nfit_buf + offset; | 1094 | spa = nfit_buf + offset; |
1114 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; | 1095 | spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS; |