Implemented some basic libc functions and a text console
This commit is contained in:
7
arch/x86_64/include/socks/machine/console.h
Normal file
7
arch/x86_64/include/socks/machine/console.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef SOCKS_X86_64_CONSOLE_H_
|
||||
#define SOCKS_X86_64_CONSOLE_H_
|
||||
|
||||
extern void ml_console_init(void);
|
||||
extern void ml_console_putchar(int c);
|
||||
|
||||
#endif
|
||||
11
arch/x86_64/include/socks/machine/cpu.h
Normal file
11
arch/x86_64/include/socks/machine/cpu.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef SOCKS_X86_64_CPU_H_
|
||||
#define SOCKS_X86_64_CPU_H_
|
||||
|
||||
typedef struct ml_cpu_block {
|
||||
|
||||
} ml_cpu_block;
|
||||
|
||||
extern int ml_cpu_block_init(ml_cpu_block *p);
|
||||
extern int ml_cpu_block_use(ml_cpu_block *p);
|
||||
|
||||
#endif
|
||||
8
arch/x86_64/include/socks/machine/init.h
Normal file
8
arch/x86_64/include/socks/machine/init.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef SOCKS_X86_64_INIT_H_
|
||||
#define SOCKS_X86_64_INIT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern int machine_init(uintptr_t arg);
|
||||
|
||||
#endif
|
||||
17
arch/x86_64/include/socks/machine/ports.h
Normal file
17
arch/x86_64/include/socks/machine/ports.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef SOCKS_X86_64_PORTS_H_
|
||||
#define SOCKS_X86_64_PORTS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PF_IOPORT_COUNT (65536)
|
||||
|
||||
extern uint8_t inportb(uint16_t port);
|
||||
extern uint16_t inportw(uint16_t port);
|
||||
extern uint32_t inportl(uint16_t port);
|
||||
extern void outportb(uint16_t port, uint8_t data);
|
||||
extern void outportw(uint16_t port, uint16_t data);
|
||||
extern void outportl(uint16_t port, uint32_t data);
|
||||
extern void outportsw(uint16_t port, void *data, uint32_t size);
|
||||
extern void inportsw(uint16_t port, unsigned char *data, unsigned long size);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user