source: rtems/spec/build/bsps/aarch64/xilinx-versal/linkcmds_lp64.yml @ 2f6ee01

Last change on this file since 2f6ee01 was 2f6ee01, checked in by Kinsey Moore <kinsey.moore@…>, on 07/05/22 at 18:35:28

bsps/aarch64: Use MMU pages appropriately

There were two bugs with MMU page use that were partially hiding each
other. The linker script page table section was 4x the size it needed to
be and the page table allocation routine was allocating pages PTRSIZE
times larger than it needed to. On ILP32, this resulted in incorrect but
functional allocation. On LP64, this resulted in allocation failures
earlier than expected.

  • Property mode set to 100644
File size: 3.6 KB
Line 
1SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
2build-type: config-file
3content: |
4  /* SPDX-License-Identifier: BSD-2-Clause */
5
6  /*
7   * Copyright (C) 2021 Gedare Bloom <gedare@rtems.org>
8   *
9   * Redistribution and use in source and binary forms, with or without
10   * modification, are permitted provided that the following conditions
11   * are met:
12   * 1. Redistributions of source code must retain the above copyright
13   *    notice, this list of conditions and the following disclaimer.
14   * 2. Redistributions in binary form must reproduce the above copyright
15   *    notice, this list of conditions and the following disclaimer in the
16   *    documentation and/or other materials provided with the distribution.
17   *
18   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28   * POSSIBILITY OF SUCH DAMAGE.
29   */
30
31  MEMORY {
32    RAM       : ORIGIN = ${BSP_XILINX_VERSAL_RAM_BASE} + ${BSP_XILINX_VERSAL_LOAD_OFFSET}, LENGTH = ${BSP_XILINX_VERSAL_RAM_LENGTH} - ${BSP_XILINX_VERSAL_LOAD_OFFSET} - ${BSP_XILINX_VERSAL_NOCACHE_LENGTH} - (0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES})
33    NOCACHE   : ORIGIN = ${BSP_XILINX_VERSAL_RAM_BASE} + ${BSP_XILINX_VERSAL_RAM_LENGTH} - (0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}) - ${BSP_XILINX_VERSAL_NOCACHE_LENGTH}, LENGTH = ${BSP_XILINX_VERSAL_NOCACHE_LENGTH}
34    RAM_MMU   : ORIGIN = ${BSP_XILINX_VERSAL_RAM_BASE} + ${BSP_XILINX_VERSAL_RAM_LENGTH} - (0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}), LENGTH = 0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}
35  }
36
37  REGION_ALIAS ("REGION_START",          RAM);
38  REGION_ALIAS ("REGION_VECTOR",         RAM);
39  REGION_ALIAS ("REGION_TEXT",           RAM);
40  REGION_ALIAS ("REGION_TEXT_LOAD",      RAM);
41  REGION_ALIAS ("REGION_RODATA",         RAM);
42  REGION_ALIAS ("REGION_RODATA_LOAD",    RAM);
43  REGION_ALIAS ("REGION_DATA",           RAM);
44  REGION_ALIAS ("REGION_DATA_LOAD",      RAM);
45  REGION_ALIAS ("REGION_FAST_TEXT",      RAM);
46  REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM);
47  REGION_ALIAS ("REGION_FAST_DATA",      RAM);
48  REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);
49  REGION_ALIAS ("REGION_BSS",            RAM);
50  REGION_ALIAS ("REGION_WORK",           RAM);
51  REGION_ALIAS ("REGION_STACK",          RAM);
52  REGION_ALIAS ("REGION_NOCACHE",        NOCACHE);
53  REGION_ALIAS ("REGION_NOCACHE_LOAD",   NOCACHE);
54
55  bsp_stack_exception_size = DEFINED (bsp_stack_exception_size) ? bsp_stack_exception_size : 1024;
56
57  bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1M;
58
59  bsp_vector_table_in_start_section = 1;
60
61  bsp_translation_table_base = ORIGIN (RAM_MMU);
62  bsp_translation_table_end = ORIGIN (RAM_MMU) + LENGTH (RAM_MMU);
63
64  OUTPUT_FORMAT ("elf64-littleaarch64")
65  OUTPUT_ARCH (aarch64)
66
67  INCLUDE linkcmds.base
68copyrights:
69- Copyright (C) 2021 Gedare Bloom <gedare@rtems.org>
70enabled-by: true
71install-path: ${BSP_LIBDIR}
72links: []
73target: linkcmds
74type: build
Note: See TracBrowser for help on using the repository browser.