Debugging....
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12993 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
d494f3899d
commit
2224bd26a7
|
@ -25,19 +25,9 @@
|
||||||
</natures>
|
</natures>
|
||||||
<linkedResources>
|
<linkedResources>
|
||||||
<link>
|
<link>
|
||||||
<name>board</name>
|
<name>sb</name>
|
||||||
<type>2</type>
|
<type>2</type>
|
||||||
<locationURI>CHIBIOS/os/hal/boards/ST_STM32L476_DISCOVERY</locationURI>
|
<locationURI>CHIBIOS/os/sb</locationURI>
|
||||||
</link>
|
|
||||||
<link>
|
|
||||||
<name>os</name>
|
|
||||||
<type>2</type>
|
|
||||||
<locationURI>CHIBIOS/os</locationURI>
|
|
||||||
</link>
|
|
||||||
<link>
|
|
||||||
<name>test</name>
|
|
||||||
<type>2</type>
|
|
||||||
<locationURI>CHIBIOS/test</locationURI>
|
|
||||||
</link>
|
</link>
|
||||||
</linkedResources>
|
</linkedResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "sbuser.h"
|
#include "sbuser.h"
|
||||||
|
|
||||||
|
@ -39,6 +40,9 @@ int main(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
while (true) {
|
while (true) {
|
||||||
sbSleepMilliseconds(500);
|
msg_t msg = sbMsgWait();
|
||||||
|
sbFileWrite(1U, (const uint8_t *)"Hello World!!\r\n", 15U);
|
||||||
|
sbMsgReply(msg);
|
||||||
|
// sbSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,9 @@
|
||||||
#include "chprintf.h"
|
#include "chprintf.h"
|
||||||
#include "sbhost.h"
|
#include "sbhost.h"
|
||||||
|
|
||||||
|
/* SandBox object.*/
|
||||||
|
sb_class_t sbx1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LEDs blinker thread, times are in milliseconds.
|
* LEDs blinker thread, times are in milliseconds.
|
||||||
*/
|
*/
|
||||||
|
@ -39,6 +42,7 @@ static THD_FUNCTION(Thread1, arg) {
|
||||||
chThdSleepMilliseconds(50);
|
chThdSleepMilliseconds(50);
|
||||||
palSetLine(LINE_LED_RED);
|
palSetLine(LINE_LED_RED);
|
||||||
chThdSleepMilliseconds(200);
|
chThdSleepMilliseconds(200);
|
||||||
|
(void) sbSendMessage(&sbx1, 0xF00F55AAU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +62,6 @@ static THD_FUNCTION(Unprivileged1, arg) {
|
||||||
.stdout_stream = (SandboxStream *)&SD2,
|
.stdout_stream = (SandboxStream *)&SD2,
|
||||||
.stderr_stream = (SandboxStream *)&SD2
|
.stderr_stream = (SandboxStream *)&SD2
|
||||||
};
|
};
|
||||||
sb_class_t sbx1;
|
|
||||||
|
|
||||||
(void)arg;
|
(void)arg;
|
||||||
chRegSetThreadName("unprivileged");
|
chRegSetThreadName("unprivileged");
|
||||||
|
@ -108,7 +111,7 @@ int main(void) {
|
||||||
sdStart(&SD2, NULL);
|
sdStart(&SD2, NULL);
|
||||||
|
|
||||||
/* Creating the blinker thread.*/
|
/* Creating the blinker thread.*/
|
||||||
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO,
|
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO+10,
|
||||||
Thread1, NULL);
|
Thread1, NULL);
|
||||||
|
|
||||||
/* Creating the unprivileged thread.*/
|
/* Creating the unprivileged thread.*/
|
||||||
|
|
|
@ -56,6 +56,10 @@ typedef void (*port_syscall_t)(struct port_extctx *ectx);
|
||||||
* this subsystem.
|
* this subsystem.
|
||||||
*/
|
*/
|
||||||
struct SandboxStreamVMT {
|
struct SandboxStreamVMT {
|
||||||
|
/**
|
||||||
|
* @brief Object instance offset.
|
||||||
|
*/
|
||||||
|
size_t instance_offset;
|
||||||
/**
|
/**
|
||||||
* @brief Stream write buffer method.
|
* @brief Stream write buffer method.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -117,8 +117,9 @@ void sbStart(sb_class_t *sbcp, const sb_config_t *config) {
|
||||||
|
|
||||||
/* Additional context information.*/
|
/* Additional context information.*/
|
||||||
sbcp->config = config;
|
sbcp->config = config;
|
||||||
chThdGetSelfX()->ctx.syscall.p = (const void *)sbcp;
|
sbcp->tp = chThdGetSelfX();
|
||||||
chThdGetSelfX()->ctx.syscall.psp = __get_PSP();
|
sbcp->tp->ctx.syscall.p = (const void *)sbcp;
|
||||||
|
sbcp->tp->ctx.syscall.psp = __get_PSP();
|
||||||
|
|
||||||
/* Jumping to the unprivileged code.*/
|
/* Jumping to the unprivileged code.*/
|
||||||
port_unprivileged_jump(pc, psp);
|
port_unprivileged_jump(pc, psp);
|
||||||
|
|
Loading…
Reference in New Issue