改为全局变量
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
#include "riscv.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
|
||||
@@ -694,6 +694,7 @@ int riscv_run(riscv_t* riscv) {
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "errno.h"
|
||||
#include "string.h"
|
||||
|
||||
long get_file_size(FILE *stream)
|
||||
{
|
||||
@@ -718,9 +719,10 @@ long get_file_size(FILE *stream)
|
||||
return file_size;
|
||||
}
|
||||
|
||||
riscv_t riscv={0};
|
||||
int thread_fun(void* t)
|
||||
{
|
||||
riscv_t riscv={0};
|
||||
printf("riscv start\n");
|
||||
FILE *file=fopen("riscv.bin", "rb" );
|
||||
if(file==NULL)
|
||||
{
|
||||
@@ -733,4 +735,6 @@ int thread_fun(void* t)
|
||||
fclose(file);
|
||||
|
||||
riscv_init(&riscv,riscv.rom,0x80000000,riscv.rom_size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user