Add va_list

and rename types.h into stdarg.h
This commit is contained in:
Mathieu Maret 2018-08-06 21:00:58 +02:00
parent 1f164a7a4e
commit 29f085b7aa
11 changed files with 15 additions and 10 deletions

View File

@ -1,6 +1,6 @@
#pragma once
#include "interrupt.h"
#include "types.h"
#include "stdarg.h"
#define EXCEPTION_INTERRUPT_BASE_ADDRESS 0

View File

@ -1,5 +1,5 @@
#pragma once
#include "types.h"
#include "stdarg.h"
#define IDT_NUM 256

View File

@ -1,5 +1,5 @@
#pragma once
#include "types.h"
#include "stdarg.h"
struct interrupt_frame;

View File

@ -1,5 +1,5 @@
#pragma once
#include "types.h"
#include "stdarg.h"
// NIH http://wiki.osdev.org/Inline_Assembly/Examples#I.2FO_access
static inline void outb(uint16_t port, uint8_t val)

View File

@ -1,7 +1,7 @@
#include "irq.h"
#include "idt.h"
#include "pic.h"
#include "types.h"
#include "stdarg.h"
int irqSetup()
{

View File

@ -1,4 +1,4 @@
#pragma once
#include "types.h"
#include "stdarg.h"
void *memcpy(void *dest, const void *src, size_t n );

View File

@ -7,7 +7,7 @@
#include "mem.h"
#include "multiboot.h"
#include "pit.h"
#include "types.h"
#include "stdarg.h"
#include "vga.h"
#define CHECK_FLAG(flags,bit) ((flags) & (1 << (bit)))

View File

@ -1,5 +1,5 @@
#pragma once
#include "types.h"
#include "stdarg.h"
#define PAGE_SHIFT 12

View File

@ -29,7 +29,7 @@
* @see Intel x86 doc, vol 3 chapter 3.
*/
#include "types.h"
#include "stdarg.h"
/*
* Global segment selectors (GDT) for SOS/x86.

View File

@ -45,3 +45,8 @@ typedef long ssize_t;
typedef unsigned int size_t;
typedef int ssize_t;
#endif
typedef void *va_list;
#define va_start(v, l) ((v) = (va_list) & (l) + sizeof(l))
#define va_end(v) ((v) = NULL)
#define va_arg(v, type) (*(type *)(((v)+=sizeof(type))-sizeof(type)))

View File

@ -1,5 +1,5 @@
#pragma once
#include "types.h"
#include "stdarg.h"
// https://wiki.osdev.org/Text_UI
#define BLACK 0x00