POK(kernelpart)
arch.c
Go to the documentation of this file.
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
22 #include <types.h>
23 #include <errno.h>
24 #include <core/partition.h>
25 #include "traps.h"
26 #include "space.h"
27 #include "psr.h"
28 #include "sparc_conf.h"
29 #include "syscalls.h"
30 
35 {
36  traps_init();
37  psr_disable_interupt();
38  psr_enable_traps();
39 
42 
43  return (POK_ERRNO_OK);
44 }
45 
47 {
48  psr_disable_interupt();
49 
50  return (POK_ERRNO_OK);
51 }
52 
54 {
55  psr_enable_interupt();
56 
57  return (POK_ERRNO_OK);
58 }
59 
61 {
62  while (1)
63  {
64  /* Leon3 Only ? */
65  asm volatile ("wr %g0, %asr19");
66  }
67 
68  return (POK_ERRNO_OK);
69 }
70 
75 pok_ret_t pok_arch_event_register (uint8_t vector, void (*handler)(void))
76 {
77  if (pok_sparc_isr[vector] == NULL)
78  {
79  pok_sparc_isr[vector] = handler;
80  return (POK_ERRNO_OK);
81  }
82  else
83  {
84  return (POK_ERRNO_UNAVAILABLE);
85  }
86 }
87 
92  const uint32_t local_thread_id)
93 {
94  return pok_partitions[partition_id].size - (local_thread_id * POK_USER_STACK_SIZE);
95 }
96 
97