Retro Rocket Kernel BASIC-Powered Operating System

Data Structures | Macros | Functions
kmalloc.h File Reference
`#include <stddef.h>`

## Data Structures
struct | header_t
struct | footer_t
struct | heap_t

## Macros
#define | HEAP_MAGIC 0xDEADDEADDEADDEADull

## Functions
void * | kmalloc (uint64_t size)
void * | kmalloc_ext (uint64_t size, uint8_t align, uint64_t *phys)
void | kfree (const void *addr)
heap_t * | create_heap (uint64_t addr, uint64_t end, uint64_t max, uint64_t min, uint8_t user, uint8_t rw)
void | init_heap ()
void | print_heapinfo ()
void | preboot_fail (const char *msg)
void * | kcalloc (size_t num, size_t size)
void * | krealloc (void *ptr, size_t new_size)
uint32_t | kmalloc_low (uint32_t size)
uint64_t | get_free_memory ()
uint64_t | get_used_memory ()
uint64_t | get_total_memory ()

## Detailed Description

Author
  Craig Edwards (craig.nosp@m.edwa.nosp@m.rds@b.nosp@m.rain.nosp@m.box.c.nosp@m.c)

Copyright
  Copyright (c) 2012-2023

## Macro Definition Documentation

## ◆ HEAP_MAGIC

#define HEAP_MAGIC 0xDEADDEADDEADDEADull

## Function Documentation

## ◆ create_heap()

heap_t* create_heap | ( | uint64_t | addr,
|  | uint64_t | end,
|  | uint64_t | max,
|  | uint64_t | min,
|  | uint8_t | user,
|  | uint8_t | rw
| ) |  |

## ◆ get_free_memory()

uint64_t get_free_memory | ( |  | ) |

## ◆ get_total_memory()

uint64_t get_total_memory | ( |  | ) |

## ◆ get_used_memory()

uint64_t get_used_memory | ( |  | ) |

## ◆ init_heap()

void init_heap | ( |  | ) |

## ◆ kcalloc()

void* kcalloc | ( | size_t | num,
|  | size_t | size
| ) |  |

## ◆ kfree()

void kfree | ( | const void * | addr | ) |

## ◆ kmalloc()

void* kmalloc | ( | uint64_t | size | ) |

## ◆ kmalloc_ext()

void* kmalloc_ext | ( | uint64_t | size,
|  | uint8_t | align,
|  | uint64_t * | phys
| ) |  |

## ◆ kmalloc_low()

uint32_t kmalloc_low | ( | uint32_t | size | ) |

## ◆ krealloc()

void* krealloc | ( | void * | ptr,
|  | size_t | new_size
| ) |  |

## ◆ preboot_fail()

void preboot_fail | ( | const char * | msg | ) |

## ◆ print_heapinfo()

void print_heapinfo | ( |  | ) |