meta: rename

This commit is contained in:
2024-11-02 11:31:51 +00:00
parent 065fdeec65
commit 62ec4c93ab
140 changed files with 422 additions and 857 deletions

View File

@@ -0,0 +1,23 @@
#ifndef MANGO_USER_CPU_H_
#define MANGO_USER_CPU_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ml_cpu_block {
int cpu_reserved;
} ml_cpu_block;
extern int ml_init_bootcpu(void);
extern int ml_cpu_block_init(ml_cpu_block *p);
extern int ml_cpu_block_use(ml_cpu_block *p);
extern void ml_halt_cpu(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,22 @@
#ifndef MANGO_USER_HWLOCK_H_
#define MANGO_USER_HWLOCK_H_
#define ML_HWLOCK_INIT (0)
#ifdef __cplusplus
extern "C" {
#endif
typedef int ml_hwlock_t;
extern void ml_hwlock_lock(ml_hwlock_t *lck);
extern void ml_hwlock_unlock(ml_hwlock_t *lck);
extern void ml_hwlock_lock_irqsave(ml_hwlock_t *lck, unsigned long *flags);
extern void ml_hwlock_unlock_irqrestore(ml_hwlock_t *lck, unsigned long flags);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,29 @@
#ifndef MANGO_X86_64_INIT_H_
#define MANGO_X86_64_INIT_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define __X2(x) #x
#define __X(x) __X2(x)
#ifdef __APPLE__
#define __define_initcall(fn, id) \
static initcall_t __initcall_##fn##id __used \
__section("__DATA,__initcall" __X(id) ".init") = (fn)
#else
#define __define_initcall(fn, id) \
static initcall_t __initcall_##fn##id __used \
__section("initcall" __X(id) "_init") = (fn)
#endif
extern int ml_init(uintptr_t arg);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,5 @@
#ifndef MANGO_X86_64_IRQ_H_
#define MANGO_X86_64_IRQ_H_
#endif

View File

@@ -0,0 +1,7 @@
#ifndef MANGO_USER_PMAP_H_
#define MANGO_USER_PMAP_H_
typedef uintptr_t ml_pmap_t;
typedef uint64_t ml_pfn_t;
#endif

View File

@@ -0,0 +1,34 @@
#ifndef MANGO_USER_VM_H_
#define MANGO_USER_VM_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
extern uintptr_t __pagemap_base(void);
extern uintptr_t __pagemap_limit(void);
/* kernel higher-half base virtual address. */
#define VM_KERNEL_VOFFSET (__pagemap_base())
/* direct page-mapping region.
NOTE that these are the maximum bounds of this region.
the actual size depends on the amount of physical
memory present. */
#define VM_PAGEMAP_BASE (__pagemap_base())
#define VM_PAGEMAP_LIMIT (__pagemap_limit())
#define VM_PAGE_SIZE 0x1000
#define VM_PAGE_MASK (VM_PAGE_SIZE-1)
#define VM_PAGE_SHIFT 12
#define VM_PAGE_MIN_ORDER VM_PAGE_4K
#define VM_PAGE_MAX_ORDER VM_PAGE_8M
#ifdef __cplusplus
}
#endif
#endif