POK(kernelpart)
/home/jaouen/pok_official/pok/trunk/kernel/include/bsp.h File Reference

Interfaces that BSP must provide. More...

#include <types.h>
#include <errno.h>

Go to the source code of this file.

Functions

pok_ret_t pok_bsp_init ()
pok_ret_t pok_bsp_irq_acknowledge (uint8_t irq)
pok_ret_t pok_bsp_irq_register (uint8_t irq, void(*handler)(void))
void * pok_bsp_mem_alloc (size_t size)
pok_ret_t pok_bsp_time_init ()
bool_t pok_cons_write (const char *s, size_t length)

Detailed Description

Interfaces that BSP must provide.

Author:
Julian Pidancet
Date:
2008-2009

Definition in file bsp.h.


Function Documentation

Definition at line 22 of file bsp.c.

{
   pok_cons_init ();

   return (POK_ERRNO_OK);
}

Definition at line 35 of file bsp.c.

{
   pok_pic_eoi (irq);

   return (POK_ERRNO_OK);
}
pok_ret_t pok_bsp_irq_register ( uint8_t  irq,
void(*)(void)  handler 
)

Definition at line 42 of file bsp.c.

{
   pok_pic_unmask (irq);

   pok_arch_event_register (32 + irq, handler);

   return (POK_ERRNO_OK);
}
void* pok_bsp_mem_alloc ( size_t  size)

Used for partition allocation. For SPARC support, all partitions are aligned on page size and all partition sizes have to be less than page size.

See also:
SPARC_PAGE_SIZE

Allocate data. At this time, the pok_pm_sbrk function only increment size each time we allocate memory and was not designed to free previously allocated memory.

Definition at line 34 of file bsp.c.

{
  char *res;

  res = (char *)(((unsigned int)heap_end + 4095) & ~4095);
  heap_end = res + sz;
  return res;
}

Initialize the timer, register the ISR and unmask the interrupt.

See also:
unmask_irq(irq_nbr)

Init time. freq is the frequency of the oscillator.

Definition at line 87 of file timer.c.

{
  time_inter = (BUS_FREQ * FREQ_DIV) / POK_TIMER_FREQUENCY;
  time_last = get_ppc_tb ();
  pok_arch_set_decr();

  return (POK_ERRNO_OK);
}
bool_t pok_cons_write ( const char *  s,
size_t  length 
)