mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-08-24 15:20:06 +02:00
Merge branch 'gh-pages' of git@github.com:navaro/atomthreads.git
This commit is contained in:
@@ -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 ;
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user