mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 07:19:20 +00:00
Replaced string to convert
This commit is contained in:
@ -9,6 +9,13 @@ extern "C"
|
||||
int isspace(int c);
|
||||
int isempty(char *str);
|
||||
unsigned int isdelim(char c, char *delim);
|
||||
int abs(int i);
|
||||
void swap(char *x, char *y);
|
||||
char *reverse(char *Buffer, int i, int j);
|
||||
|
||||
int atoi(const char *String);
|
||||
double atof(const char *String);
|
||||
char *itoa(int Value, char *Buffer, int Base);
|
||||
|
||||
void *memcpy(void *dest, const void *src, size_t n);
|
||||
void *memset(void *dest, int c, size_t n);
|
@ -1,2 +1,2 @@
|
||||
#pragma once
|
||||
#include <string.h>
|
||||
#include <convert.h>
|
||||
|
@ -1,11 +1,15 @@
|
||||
#ifndef __FENNIX_KERNEL_INTERNAL_MEMORY_H__
|
||||
#define __FENNIX_KERNEL_INTERNAL_MEMORY_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <boot/binfo.h>
|
||||
#include <bitmap.hpp>
|
||||
#include <lock.hpp>
|
||||
#endif // __cplusplus
|
||||
#include <types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern uint64_t _kernel_start, _kernel_end;
|
||||
extern uint64_t _kernel_text_end, _kernel_data_end, _kernel_rodata_end;
|
||||
|
||||
@ -51,6 +55,14 @@ extern uint64_t _kernel_text_end, _kernel_data_end, _kernel_rodata_end;
|
||||
|
||||
namespace Memory
|
||||
{
|
||||
enum MemoryAllocatorType
|
||||
{
|
||||
None,
|
||||
Pages,
|
||||
XallocV1,
|
||||
liballoc11
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief https://wiki.osdev.org/images/4/41/64-bit_page_tables1.png
|
||||
* @brief https://wiki.osdev.org/images/6/6b/64-bit_page_tables2.png
|
||||
@ -429,17 +441,19 @@ void operator delete[](void *Pointer);
|
||||
void operator delete(void *Pointer, long unsigned int Size);
|
||||
void operator delete[](void *Pointer, long unsigned int Size);
|
||||
|
||||
void *HeapMalloc(uint64_t Size);
|
||||
void *HeapCalloc(uint64_t n, uint64_t Size);
|
||||
void *HeapRealloc(void *Address, uint64_t Size);
|
||||
void HeapFree(void *Address);
|
||||
extern Memory::Physical KernelAllocator;
|
||||
extern Memory::PageTable *KernelPageTable;
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
EXTERNC void *HeapMalloc(uint64_t Size);
|
||||
EXTERNC void *HeapCalloc(uint64_t n, uint64_t Size);
|
||||
EXTERNC void *HeapRealloc(void *Address, uint64_t Size);
|
||||
EXTERNC void HeapFree(void *Address);
|
||||
|
||||
#define kmalloc(Size) HeapMalloc(Size)
|
||||
#define kcalloc(n, Size) HeapCalloc(n, Size)
|
||||
#define krealloc(Address, Size) HeapRealloc(Address, Size)
|
||||
#define kfree(Address) HeapFree(Address)
|
||||
|
||||
extern Memory::Physical KernelAllocator;
|
||||
extern Memory::PageTable *KernelPageTable;
|
||||
|
||||
#endif // !__FENNIX_KERNEL_INTERNAL_MEMORY_H__
|
||||
|
Reference in New Issue
Block a user