updates bsp and cleans hello.c
This commit is contained in:
parent
a5825bfd67
commit
071d9cc8eb
@ -1 +1 @@
|
|||||||
Subproject commit db3a2d68d6c7c73e32d4e2e0aae3a10e7de86576
|
Subproject commit e0807b8cddb07c2eb91dfe0b230d3121897b7a96
|
@ -15,19 +15,22 @@ int factorial(int i) {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
extern volatile uint32_t tohost;
|
|
||||||
extern volatile uint32_t fromhost;
|
|
||||||
int main() {
|
|
||||||
volatile int result = factorial(10);
|
|
||||||
volatile char string[] = "hello world with write in hello";
|
|
||||||
|
|
||||||
|
void write_tohost(char* string) {
|
||||||
volatile uint64_t payload[4] = {64, 0, (uintptr_t)string,
|
volatile uint64_t payload[4] = {64, 0, (uintptr_t)string,
|
||||||
(strlen(string) + 1)};
|
(strlen(string) + 1)};
|
||||||
tohost = (uint32_t)payload;
|
tohost = (uintptr_t)payload;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char string[] = "hello world with write in hello";
|
||||||
|
|
||||||
|
write_tohost(string);
|
||||||
|
|
||||||
write(STDOUT_FILENO, string, sizeof(string));
|
write(STDOUT_FILENO, string, sizeof(string));
|
||||||
|
|
||||||
|
int result = factorial(10);
|
||||||
printf("Factorial is %d", result);
|
printf("Factorial is %d", result);
|
||||||
// printf("End of execution");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user