Merge branch 'gh-pages' of git@github.com:navaro/atomthreads.git

This commit is contained in:
Natie van Rooyen
2010-09-29 03:08:51 +02:00
3 changed files with 110 additions and 7 deletions

82
index.html Normal file
View File

@@ -0,0 +1,82 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>kelvinlawson/atomthreads @ GitHub</title>
<style type="text/css">
body {
margin-top: 1.0em;
background-color: #984277;
font-family: "Helvetica,Arial,FreeSans";
color: #ffffff;
}
#container {
margin: 0 auto;
width: 700px;
}
h1 { font-size: 3.8em; color: #67bd88; margin-bottom: 3px; }
h1 .small { font-size: 0.4em; }
h1 a { text-decoration: none }
h2 { font-size: 1.5em; color: #67bd88; }
h3 { text-align: center; color: #67bd88; }
a { color: #67bd88; }
.description { font-size: 1.2em; margin-bottom: 30px; margin-top: 30px; font-style: italic;}
.download { float: right; }
pre { background: #000; color: #fff; padding: 15px;}
hr { border: 0; width: 80%; border-bottom: 1px solid #aaa}
.footer { text-align:center; padding-top:30px; font-style: italic; }
</style>
</head>
<body>
<a href="http://github.com/kelvinlawson/atomthreads"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
<div id="container">
<div class="download">
<a href="http://github.com/kelvinlawson/atomthreads/zipball/master">
<img border="0" width="90" src="http://github.com/images/modules/download/zip.png"></a>
<a href="http://github.com/kelvinlawson/atomthreads/tarball/master">
<img border="0" width="90" src="http://github.com/images/modules/download/tar.png"></a>
</div>
<h1><a href="http://github.com/kelvinlawson/atomthreads">atomthreads</a>
<span class="small">by <a href="http://github.com/kelvinlawson">kelvinlawson</a></span></h1>
<div class="description">
Lightweight, Portable RTOS Scheduler
</div>
<h2>License</h2>
<p>BSD</p>
<h2>Authors</h2>
<p>Kelvin Lawson (kelvinl@users.sf.net)
<br/>
<br/> </p>
<h2>Contact</h2>
<p>Kelvin Lawson (kelvinl@users.sf.net)
<br/> </p>
<h2>Download</h2>
<p>
You can download this project in either
<a href="http://github.com/kelvinlawson/atomthreads/zipball/master">zip</a> or
<a href="http://github.com/kelvinlawson/atomthreads/tarball/master">tar</a> formats.
</p>
<p>You can also clone the project with <a href="http://git-scm.com">Git</a>
by running:
<pre>$ git clone git://github.com/kelvinlawson/atomthreads</pre>
</p>
<div class="footer">
get the source code on GitHub : <a href="http://github.com/kelvinlawson/atomthreads">kelvinlawson/atomthreads</a>
</div>
</div>

View File

@@ -554,9 +554,9 @@ atomvmEnterCritical ()
* \ingroup atomvm
* \b atomvmCriticalCount
*
* Rerurns the critical cont of the current context.
* Rerurns the critical count of the current context.
*
* @return the critical cont of the current context.
* @return the critical count of the current context.
*/
int32_t
atomvmCriticalCount ()
@@ -898,6 +898,7 @@ atomvmEventSend ()
uint32_t
callbackInterruptWait (PATOMVM patomvm, PATOMVM_CALLBACK callback)
{
//WaitForSingleObject (patomvm->atomvm_int_complete, INFINITE) ;
return WaitForSingleObject (patomvm->atomvm_int, INFINITE) == WAIT_OBJECT_0 ;
}
@@ -942,12 +943,13 @@ callbackScheduleIpi (PATOMVM patomvm, PATOMVM_CALLBACK callback)
PATOMVM_CALLBACK_IPI callback_ipi = (PATOMVM_CALLBACK_IPI)callback ;
uint32_t res = 0 ;
if ((callback_ipi->target < ATOMVM_MAX_VM) &&
(g_vms[callback_ipi->target] != patomvm) ) {
if (callback_ipi->target < ATOMVM_MAX_VM) {
if (g_vms[callback_ipi->target] != patomvm) {
atomvmCtrlIntRequest ((HATOMVM)g_vms[callback_ipi->target], callback_ipi->isr) ;
res = 1 ;
atomvmCtrlIntRequest ((HATOMVM)g_vms[callback_ipi->target], callback_ipi->isr) ;
res = 1 ;
}
}
return res ;

View File

@@ -65,6 +65,12 @@ static HANDLE isr_thread_2 ;
static HANDLE isr_thread_3 ;
static HANDLE isr_thread_4 ;
void
ipi_sr()
{
printf("ipi\r\n") ;
}
void
monitor_thread (uint32_t parm)
{
@@ -72,6 +78,8 @@ monitor_thread (uint32_t parm)
int i ;
int c = 0 ;
ATOM_TCB *tcb ;
static unsigned int idle_1 = 0, idle_2 = 0, int_count = 0 ;
unsigned int delta_idle_1 , delta_idle_2 , delta_int_count ;
tcb = atomCurrentContext() ;
@@ -88,13 +96,24 @@ monitor_thread (uint32_t parm)
printf("Thr %.2d cnt %08d\t",i+TEST_THREADS/3,test_counter[i+TEST_THREADS/3]);
printf("Thr %.2d cnt %08d\n",i+TEST_THREADS*2/3,test_counter[i+TEST_THREADS*2/3]);
}
printf("\nIdle Threadd 1 Counter = %d\nIdle Theadrd 2 Counter = %d\nInterrupt Counter = %d",test2_counter,test3_counter,test_isr_count);
delta_idle_1 = test2_counter - idle_1 ;
delta_idle_2 = test3_counter - idle_2 ;
delta_int_count = test_isr_count - int_count ;
printf("\nIdle Threadd 1 Counter = %d %d %d\nIdle Theadrd 2 Counter = %d %d %d\nInterrupt Counter = %d %d %d",
test2_counter, delta_idle_1, (unsigned int)(test2_counter / c),
test3_counter, delta_idle_2, (unsigned int)(test3_counter / c),
test_isr_count, delta_int_count, (unsigned int)(test_isr_count / c));
printf ("\n\n") ;
idle_1 = test2_counter ;
idle_2 = test3_counter ;
int_count = test_isr_count ;
CRITICAL_END();
//for (i=0; i<100;i++) {
// atomvmInterruptWait () ;
//}
atomTimerDelay (150) ;
//atomvmScheduleIpi (atomvmGetVmId(), (uint32_t) ipi_sr) ;
}
}