mirror of
https://github.com/brain-hackers/lab
synced 2026-09-22 07:32:11 +09:00
add sample program of lvgl over PEG for 5gen brain
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
CROSS_COMPILE := arm-linux-gnueabihf-
|
||||
AS := $(CROSS_COMPILE)as
|
||||
AR := $(CROSS_COMPILE)ar
|
||||
|
||||
TARGET := libbrain.a
|
||||
OBJS := sys.o
|
||||
|
||||
ASFLAGS := -W
|
||||
ARFLAGS := -crs
|
||||
|
||||
.PHONY:
|
||||
all: $(TARGET)
|
||||
|
||||
.PHONY:
|
||||
clean:
|
||||
-rm -f $(TARGET) *.o
|
||||
|
||||
%.o: %.s
|
||||
$(AS) $(ASFLAGS) $< -o $@
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef H_LIB_BRAIN_H
|
||||
#define H_LIB_BRAIN_H
|
||||
|
||||
typedef unsigned long size_t;
|
||||
typedef void FILE;
|
||||
typedef void* DIR;
|
||||
|
||||
struct stat {
|
||||
unsigned int flags;
|
||||
unsigned int st_atim;
|
||||
unsigned int st_mtim;
|
||||
unsigned int st_ctim;
|
||||
size_t st_size;
|
||||
};
|
||||
|
||||
struct dirent {
|
||||
unsigned int type;
|
||||
size_t size;
|
||||
size_t filename_length;
|
||||
char filename[260];
|
||||
};
|
||||
|
||||
enum {
|
||||
SEEK_SET = 0,
|
||||
SEEK_CUR,
|
||||
SEEK_END,
|
||||
};
|
||||
|
||||
void *malloc(size_t size);
|
||||
void *realloc(void* ptr, size_t size);
|
||||
int free(void *ptr);
|
||||
void *memcpy(void *dst, const void *src, size_t n);
|
||||
void *memset(void *ptr, int ch, size_t n);
|
||||
FILE *fopen(const char *filename, const char *mode);
|
||||
int fclose(FILE *stream);
|
||||
int ftell(FILE *stream);
|
||||
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
|
||||
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
|
||||
int fseek(FILE *stream, int offset, int whence);
|
||||
int feof(FILE *stream);
|
||||
int fflush(FILE *stream);
|
||||
int fgetc(FILE *stream);
|
||||
char *fgets(char *s, int n, FILE *stream);
|
||||
int fputc(int ch, FILE *stream);
|
||||
int fputs(const char *str, FILE *stream);
|
||||
int ferror(FILE *stream);
|
||||
int remove(const char *filepath);
|
||||
int rename(const char *oldpath, const char *newpath);
|
||||
int mkdir(const char *pathname);
|
||||
int stat(const char *filepath, struct stat *buf);
|
||||
int closedir(DIR *dirp);
|
||||
struct dirent *readdir(DIR *dirp);
|
||||
DIR *opendir(const char *pathname);
|
||||
|
||||
int printf(const char *fmt,...);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
.text
|
||||
.align 4
|
||||
|
||||
.macro thunk name, addr
|
||||
.global \name
|
||||
.type \name, %function
|
||||
\name:
|
||||
ldr pc, [pc, #-4]
|
||||
.word \addr
|
||||
.endm
|
||||
|
||||
thunk malloc, 0x600063c4
|
||||
thunk free, 0x600063c8
|
||||
thunk realloc, 0x600063d0
|
||||
|
||||
thunk fopen, 0x60006400
|
||||
thunk fclose, 0x60006404
|
||||
thunk ftell, 0x60006408
|
||||
thunk fread, 0x6000640c
|
||||
thunk fwrite, 0x60006410
|
||||
thunk feof, 0x60006418
|
||||
thunk fflush, 0x6000641c
|
||||
thunk fgetc, 0x60006420
|
||||
thunk fgets, 0x60006424
|
||||
thunk fputc, 0x60006428
|
||||
thunk fputs, 0x6000642c
|
||||
thunk ferror, 0x60006430
|
||||
thunk remove, 0x60006434
|
||||
thunk rename, 0x60006438
|
||||
thunk mkdir, 0x6000643c
|
||||
thunk stat, 0x60006444
|
||||
|
||||
thunk closedir, 0x6000644c
|
||||
thunk readdir, 0x60006450
|
||||
thunk opendir, 0x60006454
|
||||
|
||||
thunk printf, 0x60092004
|
||||
thunk memset, 0x60092108
|
||||
thunk memcpy, 0x60092118
|
||||
Reference in New Issue
Block a user