#include <types.h>
#include <errno.h>
#include <libc.h>
#include <bsp.h>
#include <core/sched.h>
#include <arch.h>
#include "thread.h"
#include "msr.h"
 
Go to the source code of this file.
Macro Definition Documentation
      
        
          | #define KERNEL_STACK_SIZE   8192 | 
        
      
 
 
      
        
          | #define POK_PAGE_SIZE   (1 << 12) | 
        
      
 
 
      
        
          | #define PPC_PTE_C   (1 << 7) | 
        
      
 
 
      
        
          | #define PPC_PTE_G   (1 << 3) | 
        
      
 
 
      
        
          | #define PPC_PTE_H   (1 << 6) | 
        
      
 
 
      
        
          | #define PPC_PTE_I   (1 << 5) | 
        
      
 
 
      
        
          | #define PPC_PTE_M   (1 << 4) | 
        
      
 
 
      
        
          | #define PPC_PTE_R   (1 << 8) | 
        
      
 
 
      
        
          | #define PPC_PTE_V   (1 << 31) | 
        
      
 
 
      
        
          | #define PPC_PTE_W   (1 << 6) | 
        
      
 
 
      
        
          | #define PPC_SR_KP   (1 << 29) | 
        
      
 
 
      
        
          | #define PPC_SR_Ks   (1 << 30) | 
        
      
 
 
      
        
          | #define PPC_SR_T   (1 << 31) | 
        
      
 
 
Function Documentation
Definition at line 203 of file space.c.
{
#ifdef POK_NEEDS_DEBUG
  printf("dsi_int: part=%d, dar=%x dsisr=%x\n",
         pok_current_partition, dar, dsisr);
#endif
  if (dsisr & (1 << 30))
    {
      
      if (dar < 
spaces[pok_current_partition].size)
 
        {
          pok_insert_pte (pok_current_partition, vaddr, v);
          return;
        }
    }
#ifdef POK_NEEDS_DEBUG
   printf("[DEBUG] Infinite loop in pok_arch_dsi_int\n");
#endif
  while (1)
    ;
}
 
 
 
Definition at line 168 of file space.c.
{
#ifdef POK_NEEDS_DEBUG
  printf("isi_int: part=%d, pc=%x msr=%x\n",
         pok_current_partition, pc, msr);
  if (msr & ((1 << 28) | (1 << 27)))
  {
    printf (" Bad access\n");
  }
#endif
  if (msr & (1 << 30))
    {
      
      if (pc < 
spaces[pok_current_partition].size)
 
        {
          pok_insert_pte (pok_current_partition, vaddr, v);
          return;
        }
    }
#ifdef POK_NEEDS_DEBUG
   printf("[DEBUG] Infinite loop in pok_arch_isi_int\n");
#endif
  while (1)
    ;
}
 
 
 
      
        
          | void pok_arch_rfi  | 
          ( | 
          void  | 
           | ) | 
           | 
        
      
 
 
      
        
          | void pok_arch_space_init  | 
          ( | 
          void  | 
           | ) | 
           | 
        
      
 
Definition at line 132 of file space.c.
{
  pt_base = 0;
  pt_mask = 0x3ff;
  sdr1 = pt_base | (pt_mask >> 10);
  asm volatile ("mtsdr1 %0" : : "r"(sdr1));
}
 
 
 
Definition at line 42 of file space.c.
{
#ifdef POK_NEEDS_DEBUG
  printf ("pok_create_space: %d: %x %x\n", partition_id, addr, size);
#endif
}
 
 
 
Definition at line 64 of file space.c.
{
   (void) addr;
   return (0);
}
 
 
 
Create a new context in the given space 
Definition at line 72 of file space.c.
{
  char*      stack_addr;
  (void) partition_id;
  memset (ctx, 0, 
sizeof (*ctx));
 
  memset (vctx, 0, 
sizeof (*vctx));
 
  vctx->
sp     = stack_rel - 12;
 
#ifdef POK_NEEDS_DEBUG
  printf ("space_context_create %d: entry=%x stack=%x arg1=%x arg2=%x ksp=%x\n",
          partition_id, entry_rel, stack_rel, arg1, arg2, &vctx->
sp);
 
#endif
}
 
 
 
Switch from one space to another 
Definition at line 55 of file space.c.
{
  (void) old_partition_id;
  
  asm volatile (
"mtsr %0,%1" : : 
"r"(0), 
"r"(
PPC_SR_KP | new_partition_id));
 
}
 
 
 
Variable Documentation