POK(kernelpart)
pm.c File Reference
#include <errno.h>
#include <arch/x86/multiboot.h>
#include <types.h>
#include "pm.h"

Go to the source code of this file.

Macros

#define ALIGN_UP(boundary, val)   (val + (boundary - 1)) & (~(boundary - 1))

Functions

int pok_pm_init ()
uint32_t pok_pm_sbrk (uint32_t increment)

Variables

void * __pok_begin
void * __pok_end
uint32_t pok_multiboot_magic
uint32_t pok_multiboot_info
uint32_t pok_x86_pm_heap_start
uint32_t pok_x86_pm_brk
uint32_t pok_x86_pm_heap_end

Detailed Description

Author:
Julian Pidancet
Julien Delange
Date:
2008-2009

Definition in file pm.c.


Macro Definition Documentation

#define ALIGN_UP (   boundary,
  val 
)    (val + (boundary - 1)) & (~(boundary - 1))

Definition at line 30 of file pm.c.


Function Documentation

int pok_pm_init ( )

Definition at line 44 of file pm.c.

{
uint32_t free_mem;
mbi = (pok_multiboot_info_t*) pok_multiboot_info;
#ifdef POK_NEEDS_DMA
free_mem = MEM_16MB;
#else
free_mem = ALIGN_UP (4096, (uint32_t)(&__pok_end));
#endif
return (POK_ERRNO_OK);
}
uint32_t pok_pm_sbrk ( uint32_t  increment)

Allocation function, very basic, just allocate new memory space each time

Definition at line 68 of file pm.c.

{
uint32_t addr;
pok_x86_pm_brk += increment;
return (addr);
}

Variable Documentation

void* __pok_begin
void* __pok_end
uint32_t pok_multiboot_info
uint32_t pok_multiboot_magic
uint32_t pok_x86_pm_brk

Definition at line 40 of file pm.c.

uint32_t pok_x86_pm_heap_end

Definition at line 41 of file pm.c.

uint32_t pok_x86_pm_heap_start

Definition at line 39 of file pm.c.