[update] os

This commit is contained in:
bLueriVerLHR
2023-06-26 09:56:22 +08:00
parent 75644e4920
commit c931384e30
10 changed files with 125 additions and 31 deletions

6
laos/include/dev.h Normal file
View File

@@ -0,0 +1,6 @@
#ifndef DEV_H__
#define DEV_H__
extern char ioports[];
#endif

9
laos/include/filepath.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef FILEPATH_H__
#define FILEPATH_H__
char *basename(char *bnm, const char *path);
char *rmext(char *noext, const char *fname);
char *bearname(char *bnm, const char *fname);
#endif

View File

@@ -1,8 +1,16 @@
#include "asm.h"
#include "defs.h"
#include "latype.h"
#include "macro.h"
#ifndef __loongarch32r
#define __loongarch32r
#endif
#include "larchintrin.h"
#ifndef LA32R_H__
#define LA32R_H__
@@ -56,18 +64,10 @@ static inline uint r_ra() {
// mem misc
//
static inline void dbar() {
asm volatile("dbar 0");
}
static inline void ibar() {
asm volatile("ibar 0");
}
// need to be tested
static inline void synchronize() {
dbar();
ibar();
__dbar(0);
__ibar(0);
}
@@ -101,4 +101,6 @@ static inline uint scw(uint wdata, intptr_t addr) {
return recv;
}
#endif

View File

@@ -4,6 +4,6 @@
#define DEV_BASE_ADDR 0xa0000000
#define SERIAL_ADDR (DEV_BASE_ADDR + 0x00000000)
#define SERIAL_OFFSET 0x00000000
#endif