[L4alpha-cvscommit] CVS: L4Alpha-apps/exreg head.S,NONE,1.1 main.c,1.1,1.2
Status: Beta
Brought to you by:
dpotts
|
From: Daniel P. <dp...@us...> - 2002-01-17 04:35:21
|
Update of /cvsroot/l4alpha/L4Alpha-apps/exreg
In directory usw-pr-cvs1:/tmp/cvs-serv10835
Modified Files:
main.c
Added Files:
head.S
Log Message:
ex_reg no longer updates pv when a destructive ex_reg (new ip etc) is called. This is to allow checkpointing to work correctly.
As all C functions and some compiled assembler need pv you can set it in an assembler stub as follows:
br pv, 1f
1: ldgp gp, 0(pv)
this is what head.S does for any function that is the entry point for ex_reg.
--- NEW FILE: head.S ---
/*
** Copyright (c) 1995, Sebastian Schoenberg
** E-mail : ss...@ir...
**
** University of Technology Dresden, Department of Computer Science
** Inistute for Operating Systems, Databases and Computer Networks
**
** $Id: head.S,v 1.1 2002/01/17 04:35:16 dpotts Exp $
**
*/
/*
** This is base for Sigma 0
** It hopefully fits into one page
*/
#include <regdef.h>
#include <pal/palcalls.h>
.text
.align 3
.globl __other_cancel
.globl __other
.globl __other_send
.globl __other_smp
.ent __other_cancel
__other_cancel:
nop
br pv, 1f
1: ldgp gp, 0(pv) # Need a gp, for bootstrap
lda pv, other_cancel
jsr ra, (pv), other_cancel
2:
.long UDBG_DEBUG
br zero, 2b
.end __other_cancel
.align 3
.ent __other
__other:
nop
br pv, 1f
1: ldgp gp, 0(pv) # Need a gp, for bootstrap
lda pv, other
jsr ra, (pv), other
2:
.long UDBG_DEBUG
br zero, 2b
.end __other
.align 3
.ent __other_send
__other_send:
nop
br pv, 1f
1: ldgp gp, 0(pv) # Need a gp, for bootstrap
lda pv, other_send
jsr ra, (pv), other_send
2:
.long UDBG_DEBUG
br zero, 2b
.end __other_send
.align 3
.ent __other_smp
__other_smp:
nop
br pv, 1f
1: ldgp gp, 0(pv) # Need a gp, for bootstrap
lda pv, other_smp
jsr ra, (pv), other_smp
2:
.long UDBG_DEBUG
br zero, 2b
.end __other_smp
Index: main.c
===================================================================
RCS file: /cvsroot/l4alpha/L4Alpha-apps/exreg/main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** main.c 2001/03/27 12:10:36 1.1
--- main.c 2002/01/17 04:35:16 1.2
***************
*** 12,15 ****
--- 12,23 ----
*
* $Log$
+ * Revision 1.2 2002/01/17 04:35:16 dpotts
+ * ex_reg no longer updates pv when a destructive ex_reg (new ip etc) is called. This is to allow checkpointing to work correctly.
+ * As all C functions and some compiled assembler need pv you can set it in an assembler stub as follows:
+ * br pv, 1f
+ * 1: ldgp gp, 0(pv)
+ *
+ * this is what head.S does for any function that is the entry point for ex_reg.
+ *
* Revision 1.1 2001/03/27 12:10:36 sjw
* Added some existing code
***************
*** 41,44 ****
--- 49,58 ----
void other_send(void);
+ /* Assembler stubs */
+ void __other_cancel(void);
+ void __other(void);
+ void __other_smp(void);
+ void __other_send(void);
+
volatile int flags[4];
***************
*** 47,52 ****
#define NTEST 100000
! //#define debug(a...) kprintf(##a)
! #define debug(a...)
extern int l4_test_cpu(void);
--- 61,66 ----
#define NTEST 100000
! #define debug(a...) kprintf(##a)
! //#define debug(a...)
extern int l4_test_cpu(void);
***************
*** 100,104 ****
debug("Exreg: UP test:\n");
! thread_ids[0] = exreg(thread_ids[0], other, &(stack2[STACKSIZE - 1]));
test(0, 1);
--- 114,118 ----
debug("Exreg: UP test:\n");
! thread_ids[0] = exreg(thread_ids[0], __other, &(stack2[STACKSIZE - 1]));
test(0, 1);
***************
*** 106,110 ****
debug("Exreg: UP: First ex-reg passed\n\r");
! thread_ids[0] = exreg(thread_ids[0], other_cancel, &(stack2[STACKSIZE - 1]));
test(0, 2);
--- 120,124 ----
debug("Exreg: UP: First ex-reg passed\n\r");
! thread_ids[0] = exreg(thread_ids[0], __other_cancel, &(stack2[STACKSIZE - 1]));
test(0, 2);
***************
*** 112,116 ****
debug("Exreg: UP: Second ex-reg passed\n\r");
! dest_tid = thread_ids[0] = exreg(thread_ids[0], other, &(stack2[STACKSIZE - 1]));
test(0, 2);
--- 126,130 ----
debug("Exreg: UP: Second ex-reg passed\n\r");
! dest_tid = thread_ids[0] = exreg(thread_ids[0], __other, &(stack2[STACKSIZE - 1]));
test(0, 2);
***************
*** 118,126 ****
debug("Exreg: UP: Third ex-reg passed\n\r");
! thread_ids[1] = exreg(thread_ids[1], other_send, &(stack3[STACKSIZE - 1]));
test(1, 2);
! thread_ids[2] = exreg(thread_ids[2], other_send, &(stack4[STACKSIZE - 1]));
test(2, 3);
--- 132,140 ----
debug("Exreg: UP: Third ex-reg passed\n\r");
! thread_ids[1] = exreg(thread_ids[1], __other_send, &(stack3[STACKSIZE - 1]));
test(1, 2);
! thread_ids[2] = exreg(thread_ids[2], __other_send, &(stack4[STACKSIZE - 1]));
test(2, 3);
***************
*** 128,132 ****
debug("Exreg: UP: Both senders started\n\r");
! thread_ids[0] = exreg(thread_ids[0], other, &(stack2[STACKSIZE - 1]));
test(0, 4);
--- 142,146 ----
debug("Exreg: UP: Both senders started\n\r");
! thread_ids[0] = exreg(thread_ids[0], __other, &(stack2[STACKSIZE - 1]));
test(0, 4);
***************
*** 144,148 ****
debug("Exreg: SMP test:\n");
! thread_ids[0] = exreg(thread_ids[0], other_smp, &(stack2[STACKSIZE - 1]));
test(0, 1);
--- 158,162 ----
debug("Exreg: SMP test:\n");
! thread_ids[0] = exreg(thread_ids[0], __other_smp, &(stack2[STACKSIZE - 1]));
test(0, 1);
***************
*** 150,154 ****
debug("Exreg: SMP: Migrate passed\n\r");
! thread_ids[0] = exreg(thread_ids[0], other, &(stack2[STACKSIZE - 1]));
test(0, 1);
--- 164,168 ----
debug("Exreg: SMP: Migrate passed\n\r");
! thread_ids[0] = exreg(thread_ids[0], __other, &(stack2[STACKSIZE - 1]));
test(0, 1);
***************
*** 156,160 ****
debug("Exreg: SMP: First ex-reg passed\n\r");
! thread_ids[0] = exreg(thread_ids[0], other_cancel, &(stack2[STACKSIZE - 1]));
test(0, 2);
--- 170,174 ----
debug("Exreg: SMP: First ex-reg passed\n\r");
! thread_ids[0] = exreg(thread_ids[0], __other_cancel, &(stack2[STACKSIZE - 1]));
test(0, 2);
***************
*** 162,166 ****
debug("Exreg: SMP: Second ex-reg passed\n\r");
! dest_tid = thread_ids[0] = exreg(thread_ids[0], other, &(stack2[STACKSIZE - 1]));
test(0, 2);
--- 176,180 ----
debug("Exreg: SMP: Second ex-reg passed\n\r");
! dest_tid = thread_ids[0] = exreg(thread_ids[0], __other, &(stack2[STACKSIZE - 1]));
test(0, 2);
***************
*** 168,176 ****
debug("Exreg: SMP: Third ex-reg passed\n\r");
! thread_ids[1] = exreg(thread_ids[1], other_send, &(stack3[STACKSIZE - 1]));
test(1, 2);
! thread_ids[2] = exreg(thread_ids[2], other_send, &(stack4[STACKSIZE - 1]));
test(2, 3);
--- 182,190 ----
debug("Exreg: SMP: Third ex-reg passed\n\r");
! thread_ids[1] = exreg(thread_ids[1], __other_send, &(stack3[STACKSIZE - 1]));
test(1, 2);
! thread_ids[2] = exreg(thread_ids[2], __other_send, &(stack4[STACKSIZE - 1]));
test(2, 3);
***************
*** 178,182 ****
debug("Exreg: SMP: Both senders started\n\r");
! thread_ids[0] = exreg(thread_ids[0], other, &(stack2[STACKSIZE - 1]));
test(0, 4);
--- 192,196 ----
debug("Exreg: SMP: Both senders started\n\r");
! thread_ids[0] = exreg(thread_ids[0], __other, &(stack2[STACKSIZE - 1]));
test(0, 4);
|