Skip to content

Commit a1a6439

Browse files
committed
added patch10.c
1 parent 39cb6ec commit a1a6439

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

  • modules/aarch64_patches/amp_challenge10
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <stdint.h>
2+
#include <stdio.h>
3+
4+
/*
5+
* These are external .bss variables.
6+
*/
7+
extern uint16_t size;
8+
extern uint8_t num_packets;
9+
10+
/*
11+
* In the future a gcc plugin will offer
12+
* __attribute__((shiva_patch(start_vaddr, len))
13+
*/
14+
uint64_t shiva_insert_patch1_start_0x9b74 = 0;
15+
uint64_t shiva_insert_patch1_end_0x9b8c = 0;
16+
17+
void * __attribute__((naked)) shiva_insert_patch1(void)
18+
{
19+
if ((num_packets * 7) != size) {
20+
printf("RTS mismatch detected\n");
21+
return 0;
22+
}
23+
}

0 commit comments

Comments
 (0)