Browse Source

add htif section in linker script, with ALIGNs to prevent MMIO and data from being placed on same page (#32)

pull/37/head
Sagar Karandikar 10 years ago
committed by Andrew Waterman
parent
commit
f73dee6f2c
  1. 10
      bbl/bbl.lds
  2. 4
      machine/mtrap.c
  3. 10
      pk/pk.lds

10
bbl/bbl.lds

@ -40,6 +40,16 @@ SECTIONS
PROVIDE( etext = . );
_etext = .;
/*--------------------------------------------------------------------*/
/* HTIF, isolated onto separate page */
/*--------------------------------------------------------------------*/
. = ALIGN(0x1000);
htif :
{
*(htif)
}
. = ALIGN(0x1000);
/*--------------------------------------------------------------------*/
/* Initialized data segment */
/*--------------------------------------------------------------------*/

4
machine/mtrap.c

@ -7,8 +7,8 @@
#include <stdarg.h>
#include <stdio.h>
volatile uint64_t tohost __attribute__((aligned(64)));
volatile uint64_t fromhost __attribute__((aligned(64)));
volatile uint64_t tohost __attribute__((aligned(64))) __attribute__((section("htif")));
volatile uint64_t fromhost __attribute__((aligned(64))) __attribute__((section("htif")));
void __attribute__((noreturn)) bad_trap()
{

10
pk/pk.lds

@ -40,6 +40,16 @@ SECTIONS
PROVIDE( etext = . );
_etext = .;
/*--------------------------------------------------------------------*/
/* HTIF, isolated onto separate page */
/*--------------------------------------------------------------------*/
. = ALIGN(0x1000);
htif :
{
*(htif)
}
. = ALIGN(0x1000);
/*--------------------------------------------------------------------*/
/* Initialized data segment */
/*--------------------------------------------------------------------*/

Loading…
Cancel
Save