Skip to content

Commit

Permalink
inmates: arm: uart-demo: move heartbeat to header file
Browse files Browse the repository at this point in the history
Moving the heartbeat function to a header file, so we can reuse
the uart-demo just by reimplementing the heartbeat on AArch64.
  • Loading branch information
tvelocity committed Jan 25, 2016
1 parent bfedd3d commit 67792e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 0 additions & 13 deletions inmates/demos/arm/uart-demo.c
Expand Up @@ -12,19 +12,6 @@

#include <inmate.h>

/*
* To ease the debugging, we can send a spurious hypercall, which should return
* -ENOSYS, but appear in the hypervisor stats for this cell.
*/
static void heartbeat(void)
{
asm volatile (
".arch_extension virt\n"
"mov r0, %0\n"
"hvc #0\n"
: : "r" (0xbea7) : "r0");
}

void inmate_main(void)
{
unsigned int i = 0, j;
Expand Down
13 changes: 13 additions & 0 deletions inmates/lib/arm/include/inmate.h
Expand Up @@ -36,6 +36,19 @@ static inline void mmio_write32(void *address, u32 value)
*(volatile u32 *)address = value;
}

/*
* To ease the debugging, we can send a spurious hypercall, which should return
* -ENOSYS, but appear in the hypervisor stats for this cell.
*/
static inline void heartbeat(void)
{
asm volatile (
".arch_extension virt\n"
"mov r0, %0\n"
"hvc #0\n"
: : "r" (0xbea7) : "r0");
}

void __attribute__((interrupt("IRQ"))) __attribute__((used)) vector_irq(void);

typedef void (*irq_handler_t)(unsigned int);
Expand Down

0 comments on commit 67792e2

Please sign in to comment.