Skip to content

Commit

Permalink
Merge pull request #61 from BhaskaraBudiredla/REL1.6+
Browse files Browse the repository at this point in the history
Increase IORT named component node length to 256 bytes
  • Loading branch information
prasanth-pulla authored Jan 18, 2019
2 parents c4457f9 + 62910ff commit df0ea7f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
7 changes: 5 additions & 2 deletions platform/pal_uefi/include/pal_uefi.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @file
* Copyright (c) 2017, ARM Limited or its affiliates. All rights reserved.
* Copyright (c) 2016-2019, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -230,8 +231,10 @@ typedef union {
ID_MAP map;
}NODE_DATA_MAP;

#define MAX_NAMED_COMP_LENGTH 256

typedef union {
CHAR8 name[16];
CHAR8 name[MAX_NAMED_COMP_LENGTH];
IOVIRT_RC_INFO_BLOCK rc;
IOVIRT_PMCG_INFO_BLOCK pmcg;
UINT32 its_count;
Expand Down
8 changes: 5 additions & 3 deletions platform/pal_uefi/src/pal_iovirt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @file
* Copyright (c) 2017, ARM Limited or its affiliates. All rights reserved.
* Copyright (c) 2016-2019, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -225,7 +226,7 @@ iort_add_block(IORT_TABLE *iort, IORT_NODE *iort_node, IOVIRT_INFO_TABLE *IoVirt

sbsa_print(AVS_PRINT_INFO, L"IORT node offset:%x, type: %d\n", (UINT8*)iort_node - (UINT8*)iort, iort_node->type);

SetMem(data, 0, sizeof(NODE_DATA));
SetMem(data, sizeof(NODE_DATA), 0);

/* Populate the fields that are independent of node type */
(*block)->type = iort_node->type;
Expand All @@ -243,7 +244,8 @@ iort_add_block(IORT_TABLE *iort, IORT_NODE *iort_node, IOVIRT_INFO_TABLE *IoVirt
count = &IoVirtTable->num_its_groups;
break;
case IOVIRT_NODE_NAMED_COMPONENT:
AsciiStrnCpyS((CHAR8*)(*data).name, 16, (CHAR8*)((IORT_NAMED_COMPONENT*)node_data)->device_name, 16);
AsciiStrnCpyS((CHAR8*)(*data).name, MAX_NAMED_COMP_LENGTH,
(CHAR8*)((IORT_NAMED_COMPONENT*)node_data)->device_name, (MAX_NAMED_COMP_LENGTH -1));
count = &IoVirtTable->num_named_components;
break;
case IOVIRT_NODE_PCI_ROOT_COMPLEX:
Expand Down
7 changes: 5 additions & 2 deletions val/include/pal_interface.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @file
* Copyright (c) 2016, ARM Limited or its affiliates. All rights reserved.
* Copyright (c) 2016-2019, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -280,8 +281,10 @@ typedef union {
ID_MAP map;
}NODE_DATA_MAP;

#define MAX_NAMED_COMP_LENGTH 256

typedef union {
char name[16];
char name[MAX_NAMED_COMP_LENGTH];
IOVIRT_RC_INFO_BLOCK rc;
IOVIRT_PMCG_INFO_BLOCK pmcg;
uint32_t its_count;
Expand Down

0 comments on commit df0ea7f

Please sign in to comment.