You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.7 KiB
C++
71 lines
1.7 KiB
C++
// vim: set noet ts=4 sw=4:
|
|
|
|
#include "appl.h"
|
|
#include "../../device/ps2controller.h"
|
|
#include "../../object/outputstream.h"
|
|
#include "../../device/textstream.h"
|
|
#include "../../sync/ticketlock.h"
|
|
#include "../../arch/core.h"
|
|
#include "../../interrupt/guard.h"
|
|
#include "../../debug/output.h"
|
|
#include "../../arch/context.h"
|
|
#include "../../thread/scheduler.h"
|
|
|
|
extern Scheduler sch;
|
|
static uint8_t appl_cnt = 0;
|
|
|
|
char text[] = "Ich mag\n\
|
|
Saftige Pflaumen voller Aroma\n\
|
|
Ich knuddel jede Oma ins Koma\n\
|
|
Ich bin Großmutterknuddler, Großmutterknuddler\n\
|
|
Ich bin Großmutterknuddler, ich bin Großmutterknuddler\n\
|
|
\n\
|
|
Saftige Pflaumen voller Aroma\n\
|
|
Ich knuddel jede Oma ins Koma\n\
|
|
Ich bin Großmutterknuddler, Großmutterknuddler\n\
|
|
Ich bin Großmuttersniffer\n\
|
|
Und wacht sie aus'm Koma auf, kriegt sie von mir 'n Sticker\n\
|
|
\n";
|
|
|
|
extern Ticketlock koutlock;
|
|
extern Context* test2; extern Context* test1;
|
|
extern uint8_t test1_stack[], test2_stack[];
|
|
void activeWaitDelay(uint64_t cycles) {
|
|
uint64_t counter = 0; // Use volatile to prevent optimization
|
|
for (uint64_t i = 0; i < cycles; ++i) {
|
|
counter++; // Simple operation to consume cycles
|
|
asm("nop");
|
|
//Core::pause();
|
|
}
|
|
}
|
|
|
|
void Application::action() { // NOLINT
|
|
uint16_t cnt = 0;
|
|
uint8_t row = appl_cnt++;
|
|
while (1) {
|
|
//koutlock.lock();
|
|
{
|
|
Guarded g = Guard::enter();
|
|
//g.vault();
|
|
g.vault().kout.setPos((unsigned)10*row,(unsigned)/*Core::getID()*2+*/1);
|
|
g.vault().kout << cnt++ << flush;
|
|
|
|
//g.vault().kout << endl << flush;
|
|
//Guard::leave();
|
|
//koutlock.unlock();
|
|
}
|
|
//Core::pause();
|
|
//activeWaitDelay(10000000);
|
|
|
|
|
|
{
|
|
Guarded g = Guard::enter();
|
|
sch.resume(true);
|
|
}
|
|
|
|
if(cnt >= sizeof(text)-1)
|
|
cnt=0;
|
|
//context_switch(test2,test1);
|
|
}
|
|
}
|