POK(kernelpart)
/home/jaouen/pok_official/pok/trunk/kernel/arch/x86/x86-qemu/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.

Defines

#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.


Define 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.

{
  pok_multiboot_info_t* mbi;
  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

  pok_x86_pm_heap_start = pok_x86_pm_brk = free_mem;

  pok_x86_pm_heap_end = (uint32_t)(mbi->mem_upper * 1024);

  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;
  
  addr = pok_x86_pm_brk;

  pok_x86_pm_brk += increment;

  return (addr);
}

Variable Documentation

void* __pok_begin
void* __pok_end

Definition at line 40 of file pm.c.

Definition at line 41 of file pm.c.

Definition at line 39 of file pm.c.