summaryrefslogtreecommitdiff
path: root/nuttx/arch/rgmp/src/x86
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/rgmp/src/x86')
-rw-r--r--nuttx/arch/rgmp/src/x86/arch_nuttx.c29
-rw-r--r--nuttx/arch/rgmp/src/x86/com.c6
-rw-r--r--nuttx/arch/rgmp/src/x86/sigentry.S4
3 files changed, 17 insertions, 22 deletions
diff --git a/nuttx/arch/rgmp/src/x86/arch_nuttx.c b/nuttx/arch/rgmp/src/x86/arch_nuttx.c
index c7b7577f3..04b8fa8c8 100644
--- a/nuttx/arch/rgmp/src/x86/arch_nuttx.c
+++ b/nuttx/arch/rgmp/src/x86/arch_nuttx.c
@@ -37,7 +37,7 @@
*
****************************************************************************/
-#include <rgmp/pmap.h>
+#include <rgmp/mmu.h>
#include <rgmp/string.h>
#include <rgmp/arch/fpu.h>
@@ -75,32 +75,27 @@ void up_initial_state(_TCB *tcb)
{
struct Trapframe *tf;
- if (tcb->pid != 0) {
- tf = (struct Trapframe *)tcb->adj_stack_ptr-1;
- memset(tf, 0, sizeof(struct Trapframe));
- tf->tf_fpu = rgmp_fpu_init_regs;
- tf->tf_eflags = 0x00000202;
- tf->tf_cs = GD_KT;
- tf->tf_ds = GD_KD;
- tf->tf_es = GD_KD;
- tf->tf_eip = (uint32_t)tcb->start;
- tcb->xcp.tf = tf;
+ if (tcb->pid) {
+ tf = (struct Trapframe *)tcb->adj_stack_ptr - 1;
+ rgmp_setup_context(&tcb->xcp.ctx, tf, tcb->start, 1);
}
+ else
+ rgmp_setup_context(&tcb->xcp.ctx, NULL, NULL, 0);
}
void push_xcptcontext(struct xcptcontext *xcp)
{
- xcp->save_eip = xcp->tf->tf_eip;
- xcp->save_eflags = xcp->tf->tf_eflags;
+ xcp->save_eip = xcp->ctx.tf->tf_eip;
+ xcp->save_eflags = xcp->ctx.tf->tf_eflags;
// set up signal entry with interrupts disabled
- xcp->tf->tf_eip = (uint32_t)up_sigentry;
- xcp->tf->tf_eflags = 0;
+ xcp->ctx.tf->tf_eip = (uint32_t)up_sigentry;
+ xcp->ctx.tf->tf_eflags = 0;
}
void pop_xcptcontext(struct xcptcontext *xcp)
{
- xcp->tf->tf_eip = xcp->save_eip;
- xcp->tf->tf_eflags = xcp->save_eflags;
+ xcp->ctx.tf->tf_eip = xcp->save_eip;
+ xcp->ctx.tf->tf_eflags = xcp->save_eflags;
}
diff --git a/nuttx/arch/rgmp/src/x86/com.c b/nuttx/arch/rgmp/src/x86/com.c
index 6a136ac7d..7983bb1bc 100644
--- a/nuttx/arch/rgmp/src/x86/com.c
+++ b/nuttx/arch/rgmp/src/x86/com.c
@@ -57,7 +57,6 @@
#include <arch/com.h>
#include <rgmp/trap.h>
-#include <rgmp/arch/console.h>
/****************************************************************************
* Pre-processor Definitions
@@ -129,7 +128,7 @@ static int up_setup(struct uart_dev_s *dev);
static void up_shutdown(struct uart_dev_s *dev);
static int up_attach(struct uart_dev_s *dev);
static void up_detach(struct uart_dev_s *dev);
-static irqreturn_t up_com_int_handler(struct Trapframe *tf, void *dev_id);
+static irqreturn_t up_com_int_handler(int irq, void *dev_id);
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
static int up_receive(struct uart_dev_s *dev, unsigned int *status);
static void up_rxint(struct uart_dev_s *dev, bool enable);
@@ -345,7 +344,7 @@ static void up_detach(struct uart_dev_s *dev)
*
****************************************************************************/
-static irqreturn_t up_com_int_handler(struct Trapframe *tf, void *dev_id)
+static irqreturn_t up_com_int_handler(int irq, void *dev_id)
{
struct uart_dev_s *dev = dev_id;
struct up_dev_s *priv = dev->priv;
@@ -622,6 +621,7 @@ void up_serialinit(void)
* writes
*
****************************************************************************/
+extern void cons_putc(int c);
int up_putc(int ch)
{
diff --git a/nuttx/arch/rgmp/src/x86/sigentry.S b/nuttx/arch/rgmp/src/x86/sigentry.S
index 98891c026..77214e811 100644
--- a/nuttx/arch/rgmp/src/x86/sigentry.S
+++ b/nuttx/arch/rgmp/src/x86/sigentry.S
@@ -39,11 +39,11 @@
.globl up_sigentry
up_sigentry:
- subl $172, %esp # 172 is the size of TrapFrame
+ subl $172, %esp # 172 is the size of Trapframe without cross ring part
pushl %esp
movl %esp, %eax
call up_sigdeliver
- addl $8, %esp # skip parameter and current_task
+ addl $8, %esp # skip parameter and tf_curregs
frstor 0(%esp)
addl $108, %esp
popal