-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8cb1a7
commit bf50352
Showing
11 changed files
with
149 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,133 +1,134 @@ | ||
/************************************************************************** | ||
BuguRTOS-0.6.x(Bugurt real time operating system) | ||
Copyright (C) 2013 anonimous | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
Please contact with me by E-mail: [email protected] | ||
A special exception to the GPL can be applied should you wish to distribute | ||
a combined work that includes BuguRTOS, without being obliged to provide | ||
the source code for any proprietary components. See the file exception.txt | ||
for full details of how and when the exception can be applied. | ||
**************************************************************************/ | ||
|
||
/***************************************************************************************** | ||
```````````````````````````````..:+oyhdmNNMMMMMMNmmdhyo+:..``````````````````````````````` | ||
``````````````````````````.:oydNMMMMMMMMMNNNNNNNNMMMMMMMMMNdy+:.`````````````````````````` | ||
```````````````````````:sdNMMMMMNdys+/::----------::/osydNMMMMMNds:``````````````````````` | ||
```````````````````.+hNMMMMmho/-..........................-/shmMMMMNh/.``````````````````` | ||
````````````````./hNMMMNho:...................................-:ohNMMMNh/````````````````` | ||
``````````````.smMMMNy/-.......:////ss++/+-.......................-+yNMMMmo.`````````````` | ||
````````````-sNMMMd+-.....:////:-...-/s::..............+o/-..........-odMMMNs.```````````` | ||
``````````.sNMMNh/....................................-o:--............./hMMMNo.`````````` | ||
`````````+mMMMh:-........................................-...............-/dMMMm/````````` | ||
```````.yMMMm/...................-::--..................:-........--........+mMMMy.``````` | ||
``````:mMMMy-.......................-::-...............-:.........-::........-yMMMd:`````` | ||
`````/NMMN+-..................::-.....-:-............../--.........-:/-.......-+NMMN:````` | ||
````+NMMm::o/-..--/+o+o+++++o+osys+//::-::.............:/....-:-::-..-++-.......:NMMN/```` | ||
```/NMMm:.-++-+yhs/-`` `dMMMMMmho+:-..............:-/+yho/:/+oyo//o-......./mMMN:``` | ||
``-NMMm/....-/--::/o+o+oo+oo++oosyss+smyo/.............:yyho-` smMMddh-......./NMMN.`` | ||
`.hMMM/......-++:-.-:oooooooooosyyhhys/...............-+osyyyyysssssooo+ohhs-......+MMMh.` | ||
`+MMMy.......-::/++:-.....-:/++++o+o/--................--/oooo+o++o+++////-y/.......hMMM/` | ||
.mMMN:.........--:---...-::/+//::--.......................--//+//-...-.....+/......./NMMd` | ||
/MMMy............-::----------....----/+-.....................-++/:---....-o-........hMMN: | ||
yMMM/.............--:://///oo+++/+++oo+-.......................-://+/:--::::.........+MMMs | ||
mMMN:................----:/h:::/:/::---.........................--/osss+++:..........:NMMd | ||
MMMd-....................:mNs:-....................................--:odo:-..........:mMMN | ||
MMMd-....................yoshyoso:--................................../mm/...........:mMMM | ||
MMMm:..................../-o/h.y-:+dooo+/:--....................-/osydddmh...........:mMMN | ||
mMMN:........................+mNs `h. -d/:/+h++ooooy+++s++y+++mo+y` yh.do...........:NMMh | ||
sMMM+........................-hmMo/ds oMo`.-o :h s:`h` `Nysd.-Ny-h:...........+MMMo | ||
/MMMh........................./smMMMMd+NMMNNMh` sN: .mNNMddNMMMMNmN+..............hMMN: | ||
.dMMN/........................./+hMMMMMMMMMMMMmhyyyNMNNMMMMMMMMMMMNsoo-............./NMMd` | ||
`+MMMh.........................-/+omMMMMMMMMMMMMMMMMMMMMMMMMMMMMms-/+...............hMMM/` | ||
`.hMMM+..........................:/-omMMMMMMMMMMMMMMMdmMdhMMMds/-..-...............oMMMy`` | ||
``.NMMN/............................--/hNN/h.`ys:dmsd:-syos+--+.................../NMMN.`` | ||
```/NMMm:...........................:+/--:+s++oo+osoo+/:-..-/+::-................/mMMN:``` | ||
````/NMMN:............................-/++/:-..........-//+/-..:+.--............/NMMN/```` | ||
`````:NMMN+-.............../+-.............-://////////:-.......+s+::.........-oNMMN:````` | ||
``````:mMMMy-..............:/o-.................................:yo//........-hMMMd-`````` | ||
```````.yMMMm+.............:o:++-...............................+y+o-......-+mMMMs.``````` | ||
`````````/mMMMd/-...........-++:+/-.---........................-ho+/.....-/dMMMm/````````` | ||
``````````.oNMMMh/............-++:++/////:....................-yo:o-...-+hMMMNo.`````````` | ||
````````````.sNMMMdo-...........-++::++:-:/+//:..............:o:/o-..-omMMMNo.```````````` | ||
``````````````.omMMMNy+-..........-/+-.:/+/:--:+++/++//:/::/+/-+/.-+hMMMMmo``````````````` | ||
`````````````````/hNMMMNho:-...............-:/:-....--::::--..-/ohNMMMNy:````````````````` | ||
```````````````````./hNMMMMmhs/-..........................-/shNMMMMNy/.``````````````````` | ||
```````````````````````:sdNMMMMMNdhso+/:----------:/+oshdNMMMMMNho:``````````````````````` | ||
``````````````````````````.:+ydNMMMMMMMMMMNNNNNNMMMMMMMMMMmds+:``````````````````````````` | ||
````````````````````````````````.:/osyhdmNNMMMMNNmdhyso/:.```````````````````````````````` | ||
****************************************************************************************** | ||
* * | ||
* This logo was graciously delivered by 10003-kun ITT: * | ||
* * | ||
* http://www.0chan.ru/r/res/9996.html * | ||
* * | ||
*****************************************************************************************/ | ||
|
||
/************************************************************************** | ||
BuguRTOS-0.6.x (Bugurt real time operating system) | ||
Copyright (C) 2015 anonimous | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
Please contact with me by E-mail: [email protected] | ||
A special exception to the GPL can be applied should you wish to distribute | ||
a combined work that includes BuguRTOS, without being obliged to provide | ||
the source code for any proprietary components. See the file exception.txt | ||
for full details of how and when the exception can be applied. | ||
**************************************************************************/ | ||
|
||
/***************************************************************************************** | ||
```````````````````````````````..:+oyhdmNNMMMMMMNmmdhyo+:..``````````````````````````````` | ||
``````````````````````````.:oydNMMMMMMMMMNNNNNNNNMMMMMMMMMNdy+:.`````````````````````````` | ||
```````````````````````:sdNMMMMMNdys+/::----------::/osydNMMMMMNds:``````````````````````` | ||
```````````````````.+hNMMMMmho/-..........................-/shmMMMMNh/.``````````````````` | ||
````````````````./hNMMMNho:...................................-:ohNMMMNh/````````````````` | ||
``````````````.smMMMNy/-.......:////ss++/+-.......................-+yNMMMmo.`````````````` | ||
````````````-sNMMMd+-.....:////:-...-/s::..............+o/-..........-odMMMNs.```````````` | ||
``````````.sNMMNh/....................................-o:--............./hMMMNo.`````````` | ||
`````````+mMMMh:-........................................-...............-/dMMMm/````````` | ||
```````.yMMMm/...................-::--..................:-........--........+mMMMy.``````` | ||
``````:mMMMy-.......................-::-...............-:.........-::........-yMMMd:`````` | ||
`````/NMMN+-..................::-.....-:-............../--.........-:/-.......-+NMMN:````` | ||
````+NMMm::o/-..--/+o+o+++++o+osys+//::-::.............:/....-:-::-..-++-.......:NMMN/```` | ||
```/NMMm:.-++-+yhs/-`` `dMMMMMmho+:-..............:-/+yho/:/+oyo//o-......./mMMN:``` | ||
``-NMMm/....-/--::/o+o+oo+oo++oosyss+smyo/.............:yyho-` smMMddh-......./NMMN.`` | ||
`.hMMM/......-++:-.-:oooooooooosyyhhys/...............-+osyyyyysssssooo+ohhs-......+MMMh.` | ||
`+MMMy.......-::/++:-.....-:/++++o+o/--................--/oooo+o++o+++////-y/.......hMMM/` | ||
.mMMN:.........--:---...-::/+//::--.......................--//+//-...-.....+/......./NMMd` | ||
/MMMy............-::----------....----/+-.....................-++/:---....-o-........hMMN: | ||
yMMM/.............--:://///oo+++/+++oo+-.......................-://+/:--::::.........+MMMs | ||
mMMN:................----:/h:::/:/::---.........................--/osss+++:..........:NMMd | ||
MMMd-....................:mNs:-....................................--:odo:-..........:mMMN | ||
MMMd-....................yoshyoso:--................................../mm/...........:mMMM | ||
MMMm:..................../-o/h.y-:+dooo+/:--....................-/osydddmh...........:mMMN | ||
mMMN:........................+mNs `h. -d/:/+h++ooooy+++s++y+++mo+y` yh.do...........:NMMh | ||
sMMM+........................-hmMo/ds oMo`.-o :h s:`h` `Nysd.-Ny-h:...........+MMMo | ||
/MMMh........................./smMMMMd+NMMNNMh` sN: .mNNMddNMMMMNmN+..............hMMN: | ||
.dMMN/........................./+hMMMMMMMMMMMMmhyyyNMNNMMMMMMMMMMMNsoo-............./NMMd` | ||
`+MMMh.........................-/+omMMMMMMMMMMMMMMMMMMMMMMMMMMMMms-/+...............hMMM/` | ||
`.hMMM+..........................:/-omMMMMMMMMMMMMMMMdmMdhMMMds/-..-...............oMMMy`` | ||
``.NMMN/............................--/hNN/h.`ys:dmsd:-syos+--+.................../NMMN.`` | ||
```/NMMm:...........................:+/--:+s++oo+osoo+/:-..-/+::-................/mMMN:``` | ||
````/NMMN:............................-/++/:-..........-//+/-..:+.--............/NMMN/```` | ||
`````:NMMN+-.............../+-.............-://////////:-.......+s+::.........-oNMMN:````` | ||
``````:mMMMy-..............:/o-.................................:yo//........-hMMMd-`````` | ||
```````.yMMMm+.............:o:++-...............................+y+o-......-+mMMMs.``````` | ||
`````````/mMMMd/-...........-++:+/-.---........................-ho+/.....-/dMMMm/````````` | ||
``````````.oNMMMh/............-++:++/////:....................-yo:o-...-+hMMMNo.`````````` | ||
````````````.sNMMMdo-...........-++::++:-:/+//:..............:o:/o-..-omMMMNo.```````````` | ||
``````````````.omMMMNy+-..........-/+-.:/+/:--:+++/++//:/::/+/-+/.-+hMMMMmo``````````````` | ||
`````````````````/hNMMMNho:-...............-:/:-....--::::--..-/ohNMMMNy:````````````````` | ||
```````````````````./hNMMMMmhs/-..........................-/shNMMMMNy/.``````````````````` | ||
```````````````````````:sdNMMMMMNdhso+/:----------:/+oshdNMMMMMNho:``````````````````````` | ||
``````````````````````````.:+ydNMMMMMMMMMMNNNNNNMMMMMMMMMMmds+:``````````````````````````` | ||
````````````````````````````````.:/osyhdmNNMMMMNNmdhyso/:.```````````````````````````````` | ||
****************************************************************************************** | ||
* * | ||
* This logo was graciously delivered by 10003-kun ITT: * | ||
* * | ||
* http://www.0chan.ru/r/res/9996.html * | ||
* * | ||
*****************************************************************************************/ | ||
|
||
#ifndef _VSMP_H_ | ||
#define _VSMP_H_ | ||
|
||
#include "../../../include/bugurt.h" | ||
|
||
|
||
#include "../../../include/bugurt.h" | ||
|
||
extern stack_t * bugurt_save_context( void ); | ||
extern void bugurt_restore_context( stack_t * new_sp ); | ||
extern void bugurt_restore_context( stack_t * new_sp ); | ||
extern void bugurt_pop_context(void); | ||
extern void bugurt_set_stack_pointer( stack_t * new_sp ); | ||
extern void bugurt_push_pointer( void * pointer ); | ||
extern void bugurt_set_stack_pointer( stack_t * new_sp ); | ||
extern void bugurt_push_pointer( void * pointer ); | ||
extern stack_t * bugurt_reverse_byte_order ( stack_t * arg ); | ||
|
||
typedef struct _vsmp_vm_t vsmp_vm_t; | ||
struct _vsmp_vm_t | ||
{ | ||
item_t * int_fifo; // Virtual interrupt fifo; | ||
bool_t int_enabled;// Virtual interrupts enabled flag; | ||
count_t int_nest_count; | ||
stack_t * sp; // VM stack pointer | ||
stack_t * int_sp; // VM virtual interrupt stack pointer | ||
}; | ||
|
||
typedef struct _vinterrupt_t vinterrupt_t; | ||
struct _vinterrupt_t | ||
{ | ||
item_t parent; | ||
count_t num_pending; | ||
void (*isr)(void); // Virtual Interrupt Service Routine | ||
}; | ||
|
||
vsmp_vm_t vm_state[MAX_CORES]; | ||
stack_t vm_stack[MAX_CORES -1][VM_STACK_SIZE]; | ||
stack_t vm_int_stack[MAX_CORES][VM_INT_STACK_SIZE]; | ||
core_id_t current_vm; | ||
void * vm_buf; | ||
void (*vsmp_systimer_hook)(void); | ||
|
||
#define VINTERRUPT_INIT(v, f) { INIT_ITEM_T(v), (count_t)0, f } | ||
|
||
void vsmp_vm_init( vsmp_vm_t * vm, stack_t * sp, stack_t * int_sp ); | ||
|
||
void vsmp_init( void ); | ||
void vsmp_run( void ); | ||
|
||
void vsmp_idle_main( void * arg ); | ||
|
||
void _vsmp_vinterrupt(void); | ||
void vsmp_vinterrupt_init( vinterrupt_t * vector, void (*isr)(void) ); | ||
bool_t vsmp_vinterrupt_isr( core_id_t vm, vinterrupt_t * vector ); | ||
void vsmp_vinterrupt( core_id_t vm, vinterrupt_t * vector ); | ||
|
||
void vinterrupt_wrapper(void); | ||
|
||
typedef struct _vsmp_vm_t vsmp_vm_t; | ||
struct _vsmp_vm_t | ||
{ | ||
volatile item_t * int_fifo; // Virtual interrupt fifo; | ||
volatile bool_t int_enabled;// Virtual interrupts enabled flag; | ||
volatile count_t int_nest_count; | ||
stack_t * sp; // VM stack pointer | ||
stack_t * int_sp; // VM virtual interrupt stack pointer | ||
}; | ||
|
||
typedef struct _vinterrupt_t vinterrupt_t; | ||
struct _vinterrupt_t | ||
{ | ||
item_t parent; | ||
count_t num_pending; | ||
void (*isr)(void); // Virtual Interrupt Service Routine | ||
}; | ||
|
||
vsmp_vm_t vm_state[MAX_CORES]; | ||
stack_t vm_stack[MAX_CORES -1][VM_STACK_SIZE]; | ||
stack_t vm_int_stack[MAX_CORES][VM_INT_STACK_SIZE]; | ||
volatile core_id_t current_vm; | ||
volatile void * vm_buf; | ||
typedef void (*hook_t)(void); | ||
hook_t vsmp_systimer_hook; | ||
|
||
#define VINTERRUPT_INIT(v, f) { INIT_ITEM_T(v), (count_t)0, f } | ||
|
||
void vsmp_vm_init( vsmp_vm_t * vm, stack_t * sp, stack_t * int_sp ); | ||
|
||
void vsmp_init( void ); | ||
void vsmp_run( void ); | ||
|
||
void vsmp_idle_main( void * arg ); | ||
|
||
void _vsmp_vinterrupt(void); | ||
void vsmp_vinterrupt_init( vinterrupt_t * vector, void (*isr)(void) ); | ||
bool_t vsmp_vinterrupt_isr( core_id_t vm, vinterrupt_t * vector ); | ||
void vsmp_vinterrupt( core_id_t vm, vinterrupt_t * vector ); | ||
|
||
void vinterrupt_wrapper(void); | ||
bool_t vsmp_do_interrupt(void); | ||
#endif // _VSMP_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
<CodeBlocks_workspace_file> | ||
<Workspace title="Workspace"> | ||
<Project filename="sched/sched.cbp" /> | ||
<Project filename="sched/sched.cbp" active="1" /> | ||
<Project filename="proc/proc.cbp" /> | ||
<Project filename="sig/sig.cbp" /> | ||
<Project filename="ipc/ipc.cbp" /> | ||
<Project filename="sem/sem.cbp" active="1" /> | ||
<Project filename="sem/sem.cbp" /> | ||
<Project filename="mutex/mutex.cbp" /> | ||
</Workspace> | ||
</CodeBlocks_workspace_file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters