waba-commits Mailing List for Waba Virtual Machine (Page 30)
Status: Abandoned
Brought to you by:
bornet
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(34) |
Sep
(34) |
Oct
(86) |
Nov
(31) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(105) |
Feb
(23) |
Mar
(1) |
Apr
(6) |
May
(4) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
(14) |
Feb
(1) |
Mar
(10) |
Apr
(60) |
May
(82) |
Jun
(22) |
Jul
(2) |
Aug
(39) |
Sep
|
Oct
(32) |
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(117) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(13) |
From: MURANAKA M. <mo...@us...> - 2001-09-02 10:06:54
|
Update of /cvsroot/waba/waba/vm/palm In directory usw-pr-cvs1:/tmp/cvs-serv27666/palm Modified Files: nmpalm_c.c nmpalm_c.h Log Message: Implemented Vm.exit(). It corresponds to System.exit(). We have already got MainWindow.exit() but console application because it isn't defined as static. Even if it was defined as static, it's funny to call UI packages from console application. Index: nmpalm_c.c =================================================================== RCS file: /cvsroot/waba/waba/vm/palm/nmpalm_c.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nmpalm_c.c 2001/09/02 03:48:43 1.7 --- nmpalm_c.c 2001/09/02 10:06:50 1.8 *************** *** 3762,3765 **** --- 3762,3785 ---- } + Var VmExit(Var stack[]) + { + Var v; + int32 exitcode; + + v.obj = 0; + exitcode = stack[0].intValue; + + if (isApplication) + { + postStopEvent(); // see nmpalm_b.c + } + else + { + //exit(exitcode); + } + + return v; + } + Var VmSleep(Var stack[]) { Index: nmpalm_c.h =================================================================== RCS file: /cvsroot/waba/waba/vm/palm/nmpalm_c.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nmpalm_c.h 2001/08/18 20:26:21 1.4 --- nmpalm_c.h 2001/09/02 10:06:50 1.5 *************** *** 78,81 **** --- 78,82 ---- FUNC(VmGetTimeStamp); FUNC(copyArray); + FUNC(VmExit); FUNC(VmSleep); FUNC(VmSetDeviceAutoOff); |
From: MURANAKA M. <mo...@us...> - 2001-09-02 10:06:54
|
Update of /cvsroot/waba/waba/vm In directory usw-pr-cvs1:/tmp/cvs-serv27666 Modified Files: waba.c waba.h Log Message: Implemented Vm.exit(). It corresponds to System.exit(). We have already got MainWindow.exit() but console application because it isn't defined as static. Even if it was defined as static, it's funny to call UI packages from console application. Index: waba.c =================================================================== RCS file: /cvsroot/waba/waba/vm/waba.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** waba.c 2001/09/02 07:24:02 1.16 --- waba.c 2001/09/02 10:06:50 1.17 *************** *** 101,104 **** --- 101,106 ---- int vmInitialized = 0; + int isApplication = FALSE; + // virtual machine stack #if FIXED_VMSTACK_SIZE > 0 *************** *** 2486,2489 **** --- 2488,2493 ---- // waba/sys/Vm_copyArray_(Ljava/lang/Object;ILjava/lang/Object;II)Z { 114004019ul, copyArray }, + // waba/sys/Vm_exit_(I)V + { 114010760ul, VmExit }, // waba/sys/Vm_sleep_(I)V { 114016841ul, VmSleep }, Index: waba.h =================================================================== RCS file: /cvsroot/waba/waba/vm/waba.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** waba.h 2001/08/19 00:28:28 1.9 --- waba.h 2001/09/02 10:06:50 1.10 *************** *** 927,930 **** --- 927,931 ---- extern int vmInitialized; + extern int isApplication; // virtual machine stack |
From: MURANAKA M. <mo...@us...> - 2001-09-02 10:06:54
|
Update of /cvsroot/waba/waba/vm/win32 In directory usw-pr-cvs1:/tmp/cvs-serv27666/win32 Modified Files: nmwin32_c.c nmwin32_c.h Log Message: Implemented Vm.exit(). It corresponds to System.exit(). We have already got MainWindow.exit() but console application because it isn't defined as static. Even if it was defined as static, it's funny to call UI packages from console application. Index: nmwin32_c.c =================================================================== RCS file: /cvsroot/waba/waba/vm/win32/nmwin32_c.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** nmwin32_c.c 2001/09/02 03:48:43 1.10 --- nmwin32_c.c 2001/09/02 10:06:51 1.11 *************** *** 3359,3362 **** --- 3359,3380 ---- } + Var VmExit(Var stack[]) + { + Var v; + int32 exitcode; + + v.obj = 0; + exitcode = stack[0].intValue; + + if (isApplication) + { + PostQuitMessage(exitCode); + } + else + { + exit(exitcode); + } + } + Var VmSleep(Var stack[]) { Index: nmwin32_c.h =================================================================== RCS file: /cvsroot/waba/waba/vm/win32/nmwin32_c.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nmwin32_c.h 2001/08/18 20:26:21 1.5 --- nmwin32_c.h 2001/09/02 10:06:51 1.6 *************** *** 47,50 **** --- 47,51 ---- FUNC(VmGetTimeStamp); FUNC(copyArray); + FUNC(VmExit); FUNC(VmSleep); FUNC(VmSetDeviceAutoOff); |
From: MURANAKA M. <mo...@us...> - 2001-09-02 10:06:54
|
Update of /cvsroot/waba/waba/vm/port In directory usw-pr-cvs1:/tmp/cvs-serv27666/port Modified Files: nmport_c.c nmport_c.h Log Message: Implemented Vm.exit(). It corresponds to System.exit(). We have already got MainWindow.exit() but console application because it isn't defined as static. Even if it was defined as static, it's funny to call UI packages from console application. Index: nmport_c.c =================================================================== RCS file: /cvsroot/waba/waba/vm/port/nmport_c.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nmport_c.c 2001/09/02 03:48:43 1.6 --- nmport_c.c 2001/09/02 10:06:50 1.7 *************** *** 990,993 **** --- 990,1002 ---- } + Var VmExit(Var stack[]) + { + Var v; + int32 exitcode; + + v.obj = 0; + return v; + } + static Var VmSleep(Var stack[]) { Index: nmport_c.h =================================================================== RCS file: /cvsroot/waba/waba/vm/port/nmport_c.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nmport_c.h 2001/08/18 20:26:21 1.2 --- nmport_c.h 2001/09/02 10:06:50 1.3 *************** *** 47,50 **** --- 47,51 ---- FUNC(VmGetTimeStamp); FUNC(copyArray); + FUNC(VmExit); FUNC(VmSleep); FUNC(VmSetDeviceAutoOff); |
From: MURANAKA M. <mo...@us...> - 2001-09-02 10:06:54
|
Update of /cvsroot/waba/waba/vm/linux In directory usw-pr-cvs1:/tmp/cvs-serv27666/linux Modified Files: nm_linux_b.c nm_linux_c.c nm_linux_c.h Log Message: Implemented Vm.exit(). It corresponds to System.exit(). We have already got MainWindow.exit() but console application because it isn't defined as static. Even if it was defined as static, it's funny to call UI packages from console application. Index: nm_linux_b.c =================================================================== RCS file: /cvsroot/waba/waba/vm/linux/nm_linux_b.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** nm_linux_b.c 2001/09/02 07:24:03 1.14 --- nm_linux_b.c 2001/09/02 10:06:50 1.15 *************** *** 56,61 **** #endif - int isApplication = FALSE; - HELPER void * ui_init() { --- 56,59 ---- Index: nm_linux_c.c =================================================================== RCS file: /cvsroot/waba/waba/vm/linux/nm_linux_c.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** nm_linux_c.c 2001/08/18 20:26:21 1.20 --- nm_linux_c.c 2001/09/02 10:06:50 1.21 *************** *** 2773,2776 **** --- 2773,2795 ---- } + Var VmExit(Var stack[]) { + Var v; + int16 exitcode; + + v.obj = 0; + exitcode = stack[0].intValue; + + if (isApplication) + { + ui_exit(exitcode); + } + else + { + exit(exitcode); + } + + return v; + } + /* implementation of native waba/sys/Vm.getPlatform() */ Var VmGetPlatform( Var stack[] ) { Index: nm_linux_c.h =================================================================== RCS file: /cvsroot/waba/waba/vm/linux/nm_linux_c.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** nm_linux_c.h 2001/09/02 04:33:52 1.13 --- nm_linux_c.h 2001/09/02 10:06:50 1.14 *************** *** 65,68 **** --- 65,69 ---- FUNC(VmGetTimeStamp); FUNC(copyArray); + FUNC(VmExit); FUNC(VmSleep); FUNC(VmSetDeviceAutoOff); |
From: MURANAKA M. <mo...@us...> - 2001-09-02 07:24:06
|
Update of /cvsroot/waba/waba/vm/win32 In directory usw-pr-cvs1:/tmp/cvs-serv5515/vm/win32 Modified Files: nmwin32_b.c nmwin32_b.h Log Message: Added Thread#currentThread(). It is just definition and still dummy. Index: nmwin32_b.c =================================================================== RCS file: /cvsroot/waba/waba/vm/win32/nmwin32_b.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nmwin32_b.c 2001/08/18 20:26:21 1.7 --- nmwin32_b.c 2001/09/02 07:24:03 1.8 *************** *** 229,232 **** --- 229,241 ---- + //*** This "ThreadCurrentThread()" method is called from "curentThread()" method. + Var ThreadCurrentThread(Var stack[]) + { + Var v; + v.obj = 0; + return v; + } + + void tickThread(void) { Index: nmwin32_b.h =================================================================== RCS file: /cvsroot/waba/waba/vm/win32/nmwin32_b.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nmwin32_b.h 2001/08/18 20:26:21 1.4 --- nmwin32_b.h 2001/09/02 07:24:03 1.5 *************** *** 118,121 **** --- 118,124 ---- //*** Isao's Multithread implementation END *** + //*** This "ThreadCurrentThread()" method is called from "curentThread()" method. + extern Var ThreadCurrentThread(Var stack[]); + void tickThread(void); int registerAsSyncronized(WClassMethod* method); |
From: MURANAKA M. <mo...@us...> - 2001-09-02 07:24:06
|
Update of /cvsroot/waba/waba/vm/linux In directory usw-pr-cvs1:/tmp/cvs-serv5515/vm/linux Modified Files: nm_linux_b.c nm_linux_b.h Log Message: Added Thread#currentThread(). It is just definition and still dummy. Index: nm_linux_b.c =================================================================== RCS file: /cvsroot/waba/waba/vm/linux/nm_linux_b.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** nm_linux_b.c 2001/08/19 01:49:56 1.13 --- nm_linux_b.c 2001/09/02 07:24:03 1.14 *************** *** 265,268 **** --- 265,276 ---- //*** Isao's Multithread implementation END *** + //*** This "ThreadCurrentThread()" method is called from "curentThread()" method. + Var ThreadCurrentThread(Var stack[]) + { + Var v; + v.obj = 0; + return v; + } + void tickThread(void) { Index: nm_linux_b.h =================================================================== RCS file: /cvsroot/waba/waba/vm/linux/nm_linux_b.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** nm_linux_b.h 2001/08/18 20:26:21 1.9 --- nm_linux_b.h 2001/09/02 07:24:03 1.10 *************** *** 138,141 **** --- 138,144 ---- //*** Isao's Multithread implementation END *** + //*** This "ThreadCurrentThread()" method is called from "curentThread()" method. + extern Var ThreadCurrentThread(Var stack[]); + #define THERE_IS_SOME_THREADS (threadListCurrentSize > 0) |
From: MURANAKA M. <mo...@us...> - 2001-09-02 07:24:06
|
Update of /cvsroot/waba/waba/vm/palm In directory usw-pr-cvs1:/tmp/cvs-serv5515/vm/palm Modified Files: nmpalm_b.c nmpalm_b.h Log Message: Added Thread#currentThread(). It is just definition and still dummy. Index: nmpalm_b.c =================================================================== RCS file: /cvsroot/waba/waba/vm/palm/nmpalm_b.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nmpalm_b.c 2001/08/18 20:26:21 1.5 --- nmpalm_b.c 2001/09/02 07:24:03 1.6 *************** *** 244,247 **** --- 244,255 ---- //*** Isao's Multithread implementation END *** + //*** This "ThreadCurrentThread()" method is called from "curentThread()" method. + Var ThreadCurrentThread(Var stack[]) + { + Var v; + v.obj = 0; + return v; + } + void tickThread(void) { Index: nmpalm_b.h =================================================================== RCS file: /cvsroot/waba/waba/vm/palm/nmpalm_b.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nmpalm_b.h 2001/08/18 20:26:21 1.4 --- nmpalm_b.h 2001/09/02 07:24:03 1.5 *************** *** 108,111 **** --- 108,114 ---- //*** Isao's Multithread implementation END *** + //*** This "ThreadCurrentThread()" method is called from "curentThread()" method. + Var ThreadCurrentThread(Var stack[]) B_SECTION; + #define THERE_IS_SOME_THREADS (threadListCurrentSize > 0) |
From: MURANAKA M. <mo...@us...> - 2001-09-02 07:24:06
|
Update of /cvsroot/waba/waba/vm In directory usw-pr-cvs1:/tmp/cvs-serv5515/vm Modified Files: waba.c Log Message: Added Thread#currentThread(). It is just definition and still dummy. Index: waba.c =================================================================== RCS file: /cvsroot/waba/waba/vm/waba.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** waba.c 2001/08/18 20:26:21 1.15 --- waba.c 2001/09/02 07:24:02 1.16 *************** *** 2609,2612 **** --- 2609,2614 ---- // waba/sys/Thread_sleep_(I)V { 1812972105ul, ThreadSleep }, + // waba/sys/Thread_currentThread_()Lwaba/sys/Thread + { 1812986080ul, ThreadCurrentThread }, #endif |
From: MURANAKA M. <mo...@us...> - 2001-09-02 07:24:06
|
Update of /cvsroot/waba/waba/waba_classes/waba/sys In directory usw-pr-cvs1:/tmp/cvs-serv5515/waba_classes/waba/sys Modified Files: Thread.java Log Message: Added Thread#currentThread(). It is just definition and still dummy. Index: Thread.java =================================================================== RCS file: /cvsroot/waba/waba/waba_classes/waba/sys/Thread.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Thread.java 2001/08/18 20:37:52 1.4 --- Thread.java 2001/09/02 07:24:03 1.5 *************** *** 78,81 **** --- 78,83 ---- public final native void signalAll(); + + public static native Thread currentThread(); } |
From: MURANAKA M. <mo...@us...> - 2001-09-02 07:24:06
|
Update of /cvsroot/waba/waba/vm/port In directory usw-pr-cvs1:/tmp/cvs-serv5515/vm/port Modified Files: nmport_b.c nmport_b.h Log Message: Added Thread#currentThread(). It is just definition and still dummy. Index: nmport_b.c =================================================================== RCS file: /cvsroot/waba/waba/vm/port/nmport_b.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nmport_b.c 2001/08/18 20:26:21 1.3 --- nmport_b.c 2001/09/02 07:24:03 1.4 *************** *** 161,164 **** --- 161,172 ---- } + //*** This "ThreadCurrentThread()" method is called from "curentThread()" method. + Var ThreadCurrentThread(Var stack[]) + { + Var v; + v.obj = 0; + return v; + } + void tickThread(void) { Index: nmport_b.h =================================================================== RCS file: /cvsroot/waba/waba/vm/port/nmport_b.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nmport_b.h 2001/08/18 20:26:21 1.2 --- nmport_b.h 2001/09/02 07:24:03 1.3 *************** *** 21,24 **** --- 21,27 ---- //*** Isao's Multithread implementation END *** + //*** This "ThreadCurrentThread()" method is called from "curentThread()" method. + extern Var ThreadCurrentThread(Var stack[]); + void tickThread(void); int registerAsSyncronized(WClassMethod* method); |
From: MURANAKA M. <mo...@us...> - 2001-09-02 06:06:58
|
Update of /cvsroot/waba/waba In directory usw-pr-cvs1:/tmp/cvs-serv29240 Modified Files: Tag: WABAJTRON-branch configure.in Log Message: There are so many modification. It's hard to describe all. Sorry. Index: configure.in =================================================================== RCS file: /cvsroot/waba/waba/configure.in,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -C2 -d -r1.14.2.1 -r1.14.2.2 *** configure.in 2001/08/16 04:34:56 1.14.2.1 --- configure.in 2001/09/02 06:06:56 1.14.2.2 *************** *** 53,56 **** --- 53,79 ---- + AC_ARG_WITH(toppers_targetboard, + [ --with-toppers-targetboard the name of targetboard running TOPPERS kernel], + [case $withval in + linux) + target=dummy-linuxemu-toppers + AM_CONDITIONAL(ISITRON, true) + if test "x${withval}" = xlinux; then + itron_cpu=linux + itron_sys= + fi + ;; + *) + itron_sys=${withval} + case $target in + *-*-toppers) + ;; + *) + AC_MSG_WARN(You should specify --with-toppers-targetboard with the cross compiler for toppers.) + ;; + esac + ;; + esac],) + dnl dnl init : no special compilation flags *************** *** 178,189 **** dnl to define the path to the include files for ITRON specification kernel dnl ! AC_ARG_WITH(itron_include_dir, ! [ --with-itron-include-dir absolute path to the include files for ITRON kernel], if test "x${withval}" = "xyes" -o ! -d ${withval}; then ! AC_MSG_ERROR(Invalid vaule ${withval} for --with-itron-include-dir) else ! ITRON_CFLAGS="-I${withval}" ! fi, ) dnl dnl to define the path to the include files for ITRON specification kernel --- 201,215 ---- dnl to define the path to the include files for ITRON specification kernel dnl ! AC_ARG_WITH(itron_toppers_dir, ! [ --with-itron-toppers-dir absolute path to the include files for TOPPERS rootdir], if test "x${withval}" = "xyes" -o ! -d ${withval}; then ! AC_MSG_ERROR(Invalid vaule ${withval} for --with-itron-toppers-dir) else ! ITRON_CFLAGS="${ITRON_CFLAGS} -I${withval}/jsp/include -I${withval}/jsp/config/${itron_cpu} -I${withval}/jsp/config/${itron_cpu}/${itron_sys} " ! AM_CONDITIONAL(ISITRON, true) ! fi ! , ) + dnl dnl to define the path to the include files for ITRON specification kernel *************** *** 195,198 **** --- 221,225 ---- else ITRON_CFLAGS="${ITRON_CFLAGS} -I${withval}" + AM_CONDITIONAL(ISITRON, true) fi, ) *************** *** 551,554 **** --- 578,582 ---- Makefile vm/Makefile vm/port/Makefile vm/linux/Makefile vm/palm/Makefile vm/win32/Makefile + vm/toppers/Makefile vm/ruputer/Makefile waba_classes/Makefile waba_classes/waba/Makefile waba_classes/waba/fx/Makefile |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:48:58
|
Update of /cvsroot/waba/waba/macros_m4/misc In directory usw-pr-cvs1:/tmp/cvs-serv26884/macros_m4/misc Modified Files: Tag: WABAJTRON-branch crosswaba.m4 Log Message: Modified to enable nm10200-elf (Ruputer) and *-*-toppers Index: crosswaba.m4 =================================================================== RCS file: /cvsroot/waba/waba/macros_m4/misc/crosswaba.m4,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** crosswaba.m4 2001/05/08 13:33:46 1.1 --- crosswaba.m4 2001/09/02 05:48:55 1.1.2.1 *************** *** 31,45 **** fi - if test "$with_prefix" = "m68k-palmos" ; then - - target=m68k-pic-coff - - else - if test "$with_prefix" = "i386-mingw32msvc" ; then - - target=i386-pc-mingw32msvc ! fi ! fi dnl Checks for programs. --- 31,53 ---- fi ! case "$with_prefix" in ! m68k-palmos) ! target=m68k-pic-coff ! ;; ! i386-mingw32msvc) ! target=i386-mingw32msvc ! ;; ! nm10200-elf) ! target=nm10200-elf ! ;; ! *-*-toppers) ! target=$with_prefix ! ITRON_CPU=`echo $target | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ! ITRON_SYS=`echo $target | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` ! AC_SUBST(ITRON_CPU) ! AC_SUBST(ITRON_SYS) ! ;; ! esac dnl Checks for programs. |
Update of /cvsroot/waba/waba/waba_classes/org/wabajtron/attach In directory usw-pr-cvs1:/tmp/cvs-serv26651/waba_classes/org/wabajtron/attach Added Files: Tag: WABAJTRON-branch CyclicHandler.java EventFlag.java ItronCauseException.java Kernel.java Semaphore.java Task.java Log Message: First release --- NEW FILE: CyclicHandler.java --- package org.wabajtron.attach; /** * This class is used to manipulate ITRON cyclic handler specified by their cycID. * @author MURANAKA Masaki (mon...@mo...) * @version 1.0 */ public class CyclicHandler { private int cycID; /** * Creates an instance to be attached to an existing cyclic handler. */ public CyclicHandler(int cycID) { this.cycID = cycID; } // Creates a new cyclic handler and an instance to attach //public CyclicHandler(int cycID, T_CCYC pk_ccyc); // Creates a new cyclic handle and an instance to attach //public CyclicHandler(T_CCYC pk_ccyc); /** * Obtains the event flag ID attached. */ public int getId() { return cycID; } /** * Causes attached cyclic handler to delete. * Corresponds to del_cyc(). * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ public int delete() { return ItronCauseException.E_NOSPT; } /** * Causes attached cyclic handler to start. * Corresponds to sta_cyc(). */ public native int start(); /** * Causes attached cyclic handler to stop. * Corresponds to stp_cyc(). */ public native int stop(); // //public T_RCYC refer(); } --- NEW FILE: EventFlag.java --- package org.wabajtron.attach; /** * This class is used to manipulate ITRON event flag specified by their evfID. * @author MURANAKA Masaki (mon...@mo...) * @version 1.0 */ public class EventFlag { private int evfID; /** * Creates an instance to be attached to an existing event flag */ public EventFlag(int evfID) { this.evfID = evfID; } // Creates a new event flag and an instance to attach //public EventFlag(int evfID, T_CFLG cflg); // Creates a new event flag and an instance to attach //public EventFlag(T_CFLG cflg); /** * Obtains the event flag ID attached. */ public int getId() { return evfID; } /** * Causes attached event flag to delete. * Corresponds to del_flg(). * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ public int delete() { return ItronCauseException.E_NOSPT; } /** * Causes attached event flag to set bitmap pattern. * Corresponds to set_flg(). * @param setptn bitmap pattern */ public native int set(int setptn); /** * Causes attached event flag to clear bitmap pattern. * Corresponds to clr_flg(). * @param setptn bitmap pattern */ public native int clear(int clrptn); /** * Corresponds to wai_flg(). * @see EventFlag#waitFlag(int, int, int) */ public native int waitFlag(int waitptn, int wfmode); /** * Corresponds to pol_flg(). */ public native int poll(int waitptn, int wfmode); /** * corresponds to twai_flg(). * @see EventFlag#waitFlag(int, int) */ public native int waitFlag(int waitptn, int wfmode, int tmout); //public T_RFLG refer(); public static final int TWF_ANDW = 0x00, TWF_ORW = 0x01; } --- NEW FILE: ItronCauseException.java --- package org.wabajtron.attach; /** * It is named "Exception", but it isn't inheritance of Exception class. * This naming is for getting compatibility with JTRON specification. */ public class ItronCauseException { public static final int E_SYS = -5, E_NOSPT = -9, E_RSFN = -10, E_RSTAR = -11, E_PAR = -17, E_ID = -18, E_CTX = -25, E_MACV = -26, E_OACV = 27, E_ILUSE = -28, E_NOMEM = -33, E_NOID = -34, E_OBJ = -41, E_NOEXS = -42, E_QOVR = -43, E_RLWAI = -49, E_TMOUT = -50, E_DLT = -51, E_CLS = -52, E_WBLK = -57, E_BOVR = -58; } --- NEW FILE: Kernel.java --- package org.wabajtron.attach; /** * Kernel class is a collection of the static (not instanced) functions. * @author MURANAKA Masaki (mon...@mo...) * @version 1.0 */ public class Kernel { private Kernel() {} /** * Set system time. * @param systim system time. */ public static native int setTime(int systim); /** * Get system time. */ public static native int getTime(); // Overrun handler definition. //public static int defineOverrunHandler(T_DOVR pk_dovr); /** * Rotate ready queue. * @param tskpri uITRON specified task priority. */ public static native int rotateReadyQueue(int tskpri); /** * returns current task ID. * If the WabaVM supports Green Thread, this function will return always VM's task ID. */ public static native int getRunningTaskID(); //public static native T_RSYS referSystem(); // Interrupt Handler definition. //public static void defineInterruptHandler(int inhno, T_DINH pk_dinh); /** * Caused Interrupt Handler to desable * @param inhno Interrupt Handler number. */ public static int disableInterruptHandler(int inhno) { return ItronCauseException.E_NOSPT; } // Service call definintion. //public static void defineServiceCall(int fncd, T_DSVC pk_dsvc); /** * Call service call * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ public int callServiceCall(int fncd, int[] parm) { return ItronCauseException.E_NOSPT; } // define CPU Exception Handler //public static void defineCPUExceptionHandler(int excno, T_DEXC pk_dexc); //public static T_RCFG referConfiguration(); //public static T_RVER referVersion(); public static final int TSK_SELF = 0, TSK_NONE = 0, TPRI_SELF = 0, TPRI_INI = 0; public static final int TMO_POL = 0, TMO_FEVR = -1, TMO_NBLK = -2; /* public static final int TMIN_TPRI =1, TMAX_TPRI, TMIN_MPRI = 1. TMAX_MPRI, TKERNEL_MAKER, TKERNEL_PRID, TKERNEL_SPVER, TKERNEL_PRVER, TMAX_ACTCNT, TMAX_WUPCNT, TMAX_SUSCNT, TBIT_TEXPTN, TBIT_FLGPTN, TBIT_RDVPTN, TIC_NUME, TIC_DENO, TMAX_MAXSEM; */ } --- NEW FILE: Semaphore.java --- package org.wabajtron.attach; /** * This class is used to manipulate ITRON semaphore specified by their semID. * @author MURANAKA Masaki (mon...@mo...) * @version 1.0 */ public class Semaphore { private int semID; /** * creates an instance to be attached to an existing semaphore. * @param semID semaphore ID. */ public Semaphore(int semID) { this.semID = semID; } // creates a new semaphore and an instance to attach //public Semaphore(int semID, T_CSEM csem); //creates a new semaphore and an instance to attach //public Semaphore(T_CSEM csem); /** * obtains the ID of the connected semaphore. */ public int getId() { return semID; } /** * Cause the attached semaphore to delete. * Corresponds to del_sem(). * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ public int delete() { return ItronCauseException.E_NOSPT; } /** * Corresponds to sig_sem(). */ public native int signal(); /** * Corresponds to wai_sem(). */ public native int waitSemaphore(); /** * Corresponds to preq_sem(). */ public native int poll(); /** * Corresponds to twai_sem(). */ public native int waitSemaphore(int timeout); // corresponds to ref_sem. //public T_RSEM referStatus(); } --- NEW FILE: Task.java --- package org.wabajtron.attach; /** * This class is used to manipulate ITRON tasks specified by their taskID. * @author MURANAKA Masaki (mon...@mo...) * @version 1.0 */ public class Task { private int tskID; /** * Creates an instance to be attached to an existing uITRON task. * It corresponds to cre_tsk(). */ public Task(int tskID) { this.tskID = tskID; } /* * Creates an instance to be attached to an existing task. * It corresponds to cre_tsk(). */ //public Task(Thread thread); /** * It retrieves the uITRON task ID of the connected task. * It corresponds to cre_tsk(). * public int getId() { return tskID; } /** * Obtains the instance of the attach class of the task associated with the current thread. */ public static Task currentTask() { int tskID = Task.getCurrentThreadTaskId(); return new Task(tskID); } public static native int getCurrentThreadTaskId(); /** * Causes attached uITRON task to delete. * Corresponds to del_tsk(). * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ public int delete() { return ItronCauseException.E_NOSPT; } /** * Causes attached uITRON task to activate. * Corresponds to act_tsk(). */ public native int activate(); /** * Causes attached uITRON task to activate. * Corresponds to can_act(). */ public native int cancelActivate(); /** * Causes attached uITRON task to start. * Corresponds to sta_tsk(). * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ public int start(int stacd) { return ItronCauseException.E_NOSPT; } /** * Causes attached uITRON task to terminate. * It corresponds to ter_tsk(). */ public native int terminate(); /** * Causes attached uITRON task to change priority * Corresponds to chg_pri(). */ public native int changePriority(int priority); /** * Returns task priority of attached uITRON task. * Corresponds to get_pri(). */ public native int getPriority(); // Corresponds to ref_tsk. //public T_RTSK refer(); // Corresponds to ref_tst. //public T_RTST referSimple(); /** * Causes attached uITRON task to sleep. * Corresponds to slp_tsk(). * @see Task#sleep(int) */ public native int sleep(); /** * Causes attached uITRON task to sleep. * When no task wake up, it returns error. * Corresponds to tslp_tsk(). * @param tmout timeout * @see Task#sleep() */ public native int sleep(int tmout); /** * Causes attached uITRON task to wake-up. * corresponds to wup_tsk(). */ public native int wakeup(); /** * Corresponds to can_wup(). */ public native int cancelWakeup(); /** * Corresponds to rel_wai(). */ public native int releaseWait(); /** * Causes attached uITRON task to suspend. * Corresponds to sus_tsk(). */ public native int suspend(); /** * Causes attached uITRON task to resume. * Corresponds to rsm_tsk(). * @see Task#forceResume() */ public native int resume(); /** * Causes attached uITRON task to resume. * Corresponds to frsm_tsk(). * @see Task#resume() */ public native int forceResume(); /** * Causes attached uITRON task to delay. * Corresponds to dly_tsk. * @param dlytim delay time */ public static native int delay(int dlytim); /* * This is reserved for version2.1 * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ //public int defineTaskException(T_DTEX pk_dtex) { //return ItronCauseException.E_NOSPT; //} /** * This is reserved for version2.1 */ public native int raiseTaskException(int rasptn); // //public T_RTEX referTaskException(); /** * This is reserved for version2.1 * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ public int startOverrunHandler(int ovrtim) { return ItronCauseException.E_NOSPT; } /** * This is reserved for version2.1 * When you use "standard profile specified" ITRON kernel, you will get always ItronCauseException.E_NOSPT. */ public int stopOverrunHandler() { return ItronCauseException.E_NOSPT; } // //public T_ROVR referOverrunHandler(); } |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:45:57
|
Update of /cvsroot/waba/waba/waba_classes/org/wabajtron/attach In directory usw-pr-cvs1:/tmp/cvs-serv26565/waba_classes/org/wabajtron/attach Log Message: Directory /cvsroot/waba/waba/waba_classes/org/wabajtron/attach added to the repository --> Using per-directory sticky tag `WABAJTRON-branch' |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:45:44
|
Update of /cvsroot/waba/waba/waba_classes/org/wabajtron In directory usw-pr-cvs1:/tmp/cvs-serv26535/waba_classes/org/wabajtron Log Message: Directory /cvsroot/waba/waba/waba_classes/org/wabajtron added to the repository --> Using per-directory sticky tag `WABAJTRON-branch' |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:41:12
|
Update of /cvsroot/waba/waba/vm In directory usw-pr-cvs1:/tmp/cvs-serv25896 Modified Files: Tag: WABAJTRON-branch Makefile.am Log Message: Added some objects about sjtron into libwaba_a_LIBADD Index: Makefile.am =================================================================== RCS file: /cvsroot/waba/waba/vm/Makefile.am,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -C2 -d -r1.6.2.2 -r1.6.2.3 *** Makefile.am 2001/08/16 05:15:42 1.6.2.2 --- Makefile.am 2001/09/02 05:41:09 1.6.2.3 *************** *** 3,7 **** noinst_LIBRARIES = libwaba.a libwaba_a_SOURCES = waba.c ! libwaba_a_LIBADD = @PLATFORM/libnmwaba.a else --- 3,7 ---- noinst_LIBRARIES = libwaba.a libwaba_a_SOURCES = waba.c ! libwaba_a_LIBADD = @PLATFORM@/nmtoppers_a.o @PLATFORM@/nmtoppers_b.o @PLATFORM@/nmtoppers_c.o @PLATFORM@/nmtoppers_sjtron_evtflg.o @PLATFORM@/nmtoppers_sjtron_semaphore.o @PLATFORM@/nmtoppers_sjtron_kernel.o @PLATFORM@/nmtoppers_sjtron_task.o else *************** *** 41,43 **** DIST_SUBDIRS = linux palm win32 port toppers ruputer ! CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ @GTK_CFLAGS@ @CC_DEFINE@ --- 41,43 ---- DIST_SUBDIRS = linux palm win32 port toppers ruputer ! CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ @GTK_CFLAGS@ @ITRON_CFLAGS@ @CC_DEFINE@ |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:39:36
|
Update of /cvsroot/waba/waba/vm In directory usw-pr-cvs1:/tmp/cvs-serv25640 Modified Files: Tag: WABAJTRON-branch waba.h Log Message: Added include code for nmtoppers_* Index: waba.h =================================================================== RCS file: /cvsroot/waba/waba/vm/waba.h,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** waba.h 2001/08/16 04:34:56 1.6.2.1 --- waba.h 2001/09/02 05:39:34 1.6.2.2 *************** *** 12,15 **** --- 12,17 ---- #elif defined(LINUX) #include "linux/nm_linux_a.h" + #elif defined(TOPPERS) + #include "toppers/nmtoppers_a.h" #endif *************** *** 983,986 **** --- 985,991 ---- #include "linux/nm_linux_c.h" #include "linux/debug.h" + #elif defined(TOPPERS) + #include "toppers/nmtoppers_b.h" + #include "toppers/nmtoppers_c.h" #endif |
Update of /cvsroot/waba/waba/vm/toppers In directory usw-pr-cvs1:/tmp/cvs-serv25293 Modified Files: Tag: WABAJTRON-branch nmtoppers_sjtron_evtflg.h nmtoppers_sjtron_kernel.h nmtoppers_sjtron_semaphore.h nmtoppers_sjtron_task.c nmtoppers_sjtron_task.h Log Message: There has major changes. Please forget previous version. Index: nmtoppers_sjtron_evtflg.h =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_sjtron_evtflg.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** nmtoppers_sjtron_evtflg.h 2001/08/16 04:34:56 1.1.2.2 --- nmtoppers_sjtron_evtflg.h 2001/09/02 05:37:00 1.1.2.3 *************** *** 3,7 **** #include "nmtoppers_a.h" ! #include "waba.h" extern Var EventFlag_waitFlag(Var stack[]); --- 3,7 ---- #include "nmtoppers_a.h" ! #include "../waba.h" extern Var EventFlag_waitFlag(Var stack[]); Index: nmtoppers_sjtron_kernel.h =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_sjtron_kernel.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** nmtoppers_sjtron_kernel.h 2001/08/16 05:12:57 1.1.2.1 --- nmtoppers_sjtron_kernel.h 2001/09/02 05:37:00 1.1.2.2 *************** *** 3,7 **** #include "nmtoppers_a.h" ! #include "waba.h" extern Var Kernel_getRunningTaskID(Var stack[]); --- 3,7 ---- #include "nmtoppers_a.h" ! #include "../waba.h" extern Var Kernel_getRunningTaskID(Var stack[]); Index: nmtoppers_sjtron_semaphore.h =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_sjtron_semaphore.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** nmtoppers_sjtron_semaphore.h 2001/08/16 04:34:56 1.1.2.2 --- nmtoppers_sjtron_semaphore.h 2001/09/02 05:37:00 1.1.2.3 *************** *** 3,7 **** #include "nmtoppers_a.h" ! #include "waba.h" extern Var Semaphore_waitSemaphore(Var stack[]); --- 3,7 ---- #include "nmtoppers_a.h" ! #include "../waba.h" extern Var Semaphore_waitSemaphore(Var stack[]); Index: nmtoppers_sjtron_task.c =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_sjtron_task.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** nmtoppers_sjtron_task.c 2001/08/16 04:34:56 1.1.2.2 --- nmtoppers_sjtron_task.c 2001/09/02 05:37:00 1.1.2.3 *************** *** 123,127 **** // org/wabajtron/attach/Task_releaseWait_()I ! Var Task_releaseWait(Var stac[]) { WObject obj; --- 123,127 ---- // org/wabajtron/attach/Task_releaseWait_()I ! Var Task_releaseWait(Var stack[]) { WObject obj; Index: nmtoppers_sjtron_task.h =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_sjtron_task.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** nmtoppers_sjtron_task.h 2001/08/16 04:34:56 1.1.2.2 --- nmtoppers_sjtron_task.h 2001/09/02 05:37:00 1.1.2.3 *************** *** 3,7 **** #include "nmtoppers_a.h" ! #include "waba.h" extern Var Task_raiseTaskException(Var stack[]); --- 3,7 ---- #include "nmtoppers_a.h" ! #include "../waba.h" extern Var Task_raiseTaskException(Var stack[]); |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:35:58
|
Update of /cvsroot/waba/waba/vm/toppers In directory usw-pr-cvs1:/tmp/cvs-serv25193 Modified Files: Tag: WABAJTRON-branch nmtoppers_c.c Log Message: Appended some functions for waba/sys/Convert.toString Index: nmtoppers_c.c =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_c.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** nmtoppers_c.c 2001/08/13 13:42:37 1.1.2.1 --- nmtoppers_c.c 2001/09/02 05:35:56 1.1.2.2 *************** *** 18,22 **** #include "guimgl.h" #endif ! #include "waba.h" Var Return0Func(Var stack[]) --- 18,22 ---- #include "guimgl.h" #endif ! #include "../waba.h" Var Return0Func(Var stack[]) *************** *** 207,210 **** --- 207,256 ---- return v; } + + + #ifdef WITH_64BITS + + /* implementation of native waba/sys/Convert.toString(long l) */ + Var ConvertLongToString( Var stack[] ) { + Var v; + char buf[30]; + + sprintf( buf, "%lld", vars2int64( stack )); + + v.obj = createString(buf); + return v; + } + + /* implementation of native waba/sys/Convert.toString(double d) */ + Var ConvertDoubleToString( Var stack[] ) { + Var v; + char buf[40]; + // int len; + + sprintf(buf, "%lf", vars2double( stack )); + + v.obj = createString(buf); + return v; + } + + #else + + /* implementation of native waba/sys/Convert.toString(long l) : not supported */ + Var ConvertLongToString( Var stack[] ) { + Var v; + + v.obj = 0; + return v; + } + + /* implementation of native waba/sys/Convert.toString(double d) : not supported */ + Var ConvertDoubleToString( Var stack[] ) { + Var v; + + v.obj = 0; + return v; + } + + #endif /* ifdef WITH_64BITS ... else */ Var ConvertCharToString(Var stack[]) |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:34:10
|
Update of /cvsroot/waba/waba/vm/toppers In directory usw-pr-cvs1:/tmp/cvs-serv24908 Modified Files: Tag: WABAJTRON-branch nmtoppers_b.c Log Message: There are so many changes that I cannot make description. Mainly these have two reason. The one is to bind Waba thread and ITRON task. The another is to use static main() instead of MainWindow. Index: nmtoppers_b.c =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_b.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** nmtoppers_b.c 2001/08/13 13:42:37 1.1.2.1 --- nmtoppers_b.c 2001/09/02 05:34:06 1.1.2.2 *************** *** 133,137 **** */ ! #include "waba.h" #define MAX_CLASS 300 --- 133,137 ---- */ ! #include "../waba.h" #define MAX_CLASS 300 *************** *** 140,144 **** static int numClassRecords; ! #include "classes.c" static WObject globalMainWin = 0; --- 140,144 ---- static int numClassRecords; ! extern uchar classesMap[]; static WObject globalMainWin = 0; *************** *** 148,155 **** //*** Isao's Multithread implementation START *** // Thread variables - Isao F. Yamashita 07/25/2000 - WThread wThreadList[THREAD_LIST_MAX_SIZE]; ! uint32 threadListCurrentSize = 0; ! uint32 threadProcessIndex = 0; //*** This "_onThreadStart()" method is called from "start()" method. --- 148,209 ---- //*** Isao's Multithread implementation START *** // Thread variables - Isao F. Yamashita 07/25/2000 WThread wThreadList[THREAD_LIST_MAX_SIZE]; ! uint32 threadProcessIndex; ! WThread *currentThread = NULL; ! Queue usedThreadsQueue; ! Queue unusedThreadsQueue; ! ! static void InitQueue(Queue *queue) ! { ! queue->prev = queue; ! queue->next = queue; ! } ! ! static void SetQueue(Queue *queue, Queue *atom) ! { ! atom->next = queue; ! atom->prev = queue->prev; ! queue->prev->next = atom; ! queue->prev = atom; ! } ! ! static Queue *GetQueue(Queue *queue) ! { ! Queue *atom; ! ! if (queue->next == queue) ! { ! return NULL; /* Empty Queue */ ! } ! ! atom = queue->next; ! atom->next->prev = queue; ! queue->next = atom->next; ! ! return atom; ! } ! ! int InitThread(uint32 stack_size) ! { ! uint32 i; ! ! if (stack_size != -1) ! { ! /* ERROR: This version doesn't support thread stack */ ! return 1; ! } ! ! InitQueue(&usedThreadsQueue); ! InitQueue(&unusedThreadsQueue); ! ! for(i = 0; i < THREAD_LIST_MAX_SIZE; i++) ! { ! wThreadList[i].thread_id = i; ! wThreadList[i].itron_tskid = THREAD1 + i; ! SetQueue(&unusedThreadsQueue, (Queue*)&wThreadList[i]); ! } ! ! return 0; ! } //*** This "_onThreadStart()" method is called from "start()" method. *************** *** 158,162 **** Var v; WObject targetObj; ! uint32 index = 0; v.obj = 0; --- 212,217 ---- Var v; WObject targetObj; ! WThread *wThread; ! Queue *queue; v.obj = 0; *************** *** 168,177 **** // In search of the same object to remove from the thread list. ! for(index = 0; index < threadListCurrentSize; index++) { ! if(wThreadList[index].tObject == targetObj) ! { return v; ! } } --- 223,233 ---- // In search of the same object to remove from the thread list. ! for(queue = usedThreadsQueue.next; queue != &usedThreadsQueue; queue = queue->next) { ! wThread = (WThread*)queue; ! if (wThread->tObject == targetObj) ! { return v; ! } } *************** *** 181,196 **** //**************************************** //Cache method map numbers for "run" method - wThreadList[threadListCurrentSize].tObject = targetObj; - wThreadList[threadListCurrentSize].tClass = WOBJ_class(targetObj); - wThreadList[threadListCurrentSize].runMethodMapNum = - getMethodMapNum( wThreadList[threadListCurrentSize].tClass, - createUtfString("run"), - createUtfString("()V"), - SEARCH_ALL); ! threadListCurrentSize++; ! return v; } --- 237,260 ---- //**************************************** + wThread = (WThread*)GetQueue(&unusedThreadsQueue); + if (wThread == NULL) + { + // ??? error + } + //Cache method map numbers for "run" method ! wThread->tObject = targetObj; ! wThread->tClass = WOBJ_class(targetObj); ! wThread->runMethodMapNum = getMethodMapNum( wThread->tClass, ! createUtfString("run"), ! createUtfString("()V"), ! SEARCH_ALL); ! SetQueue(&usedThreadsQueue, (Queue*)wThread); ! ! act_tsk(wThread->itron_tskid); ! ! return v; } *************** *** 200,210 **** Var v; WObject targetObj; ! ! uint32 index = 0; ! uint32 targetIndex = 0; ! uint32 count = 0; v.obj = 0; - targetObj = stack[0].obj; --- 264,270 ---- Var v; WObject targetObj; ! Queue *queue; v.obj = 0; targetObj = stack[0].obj; *************** *** 213,237 **** //(A sanity check) //**************************************** ! for(; index < threadListCurrentSize; index++) { ! if(wThreadList[index].tObject == targetObj) ! { ! targetIndex = index; ! ! // Now if it created the hole in the middle, ! // bring the rest of them up by one. ! for(; (count < (threadListCurrentSize-index))&&(count < THREAD_LIST_MAX_SIZE); count++) ! { ! wThreadList[targetIndex] = wThreadList[targetIndex+1]; ! targetIndex++; ! }//End of for() ! ! threadListCurrentSize--; ! break; ! } } ! ! return v; } --- 273,292 ---- //(A sanity check) //**************************************** ! for(queue = usedThreadsQueue.next; queue != &usedThreadsQueue; queue = queue->next) { ! WThread *wThread; ! wThread = (WThread *)queue; ! if (wThread->tObject == targetObj) ! { ! queue = queue->prev; ! wThread = (WThread*)GetQueue(queue); ! ter_tsk(wThread->itron_tskid); ! SetQueue(&unusedThreadsQueue, (Queue*)wThread); ! #ifndef SANITYCHECK break; ! #endif ! } } ! return v; } *************** *** 241,262 **** Var v; WObject targetObj; ! uint32 index = 0; v.obj = 0; - targetObj = stack[0].obj; // In search of the same object to set the millisecond value. ! for(; index < threadListCurrentSize; index++) { ! if(wThreadList[index].tObject == targetObj) ! { ! if(!wThreadList[index].isSleepCountAlreadySet) ! { ! wThreadList[index].sleepCountSet = stack[1].intValue; ! wThreadList[index].isSleepCountAlreadySet = TRUE; ! } ! break; ! } } --- 296,318 ---- Var v; WObject targetObj; ! Queue *queue; v.obj = 0; targetObj = stack[0].obj; // In search of the same object to set the millisecond value. ! for(queue = usedThreadsQueue.next; queue != &usedThreadsQueue; queue = queue->next) { ! WThread *wThread; ! wThread = (WThread*)queue; ! if (wThread->tObject == targetObj) ! { ! if (wThread->isSleepCountAlreadySet == FALSE) ! { ! wThread->sleepCountSet = stack[1].intValue; ! wThread->isSleepCountAlreadySet == TRUE; ! } ! break; ! } } *************** *** 269,286 **** Var v; WObject targetObj; ! uint32 index = 0; targetObj = stack[0].obj; // In search of the same object to set the millisecond value. ! for(index = 0; index < threadListCurrentSize; index++) { ! if(wThreadList[index].tObject == targetObj) ! { ! wThreadList[index].isWaiting = TRUE; ! break; ! } } v.obj = 0; --- 325,352 ---- Var v; WObject targetObj; ! Queue *queue; + v.obj = 0; targetObj = stack[0].obj; // In search of the same object to set the millisecond value. ! for(queue = usedThreadsQueue.next; queue != &usedThreadsQueue; queue = queue->next) { ! WThread *wThread; ! wThread = (WThread*)queue; ! if (wThread->tObject = targetObj) ! { ! wThread->isWaiting = TRUE; ! } ! break; } + return v; + } + + Var ThreadSignalAll(Var stack[]) + { + Var v; + v.obj = 0; *************** *** 288,298 **** } ! Var ThreadSignalAll(Var stack[]) { ! Var v; ! v.obj = 0; ! return v; } --- 354,482 ---- } ! //*** Isao's Multithread implementation END *** ! ! ! ER waba_get_sleep_count(INT thread_number, RELTIM* p_reltim) { ! WThread *wThread; ! if (p_reltim == NULL) ! { ! return E_PAR; ! } ! wThread = &wThreadList[thread_number]; ! if (wThread->isSleepCountAlreadySet == TRUE) ! { ! *p_reltim = wThreadList[thread_number].sleepCountNow; ! } ! else ! { ! *p_reltim = 0; ! } ! return E_OK; ! } ! ER waba_set_sleep_count(INT thread_number, RELTIM reltim) ! { ! WThread *wThread; ! wThread = &wThreadList[thread_number]; ! if (reltim == 0) ! { ! wThread->isSleepCountAlreadySet = FALSE; ! wThread->sleepCountNow = 0; ! } ! else ! { ! wThread->isSleepCountAlreadySet = TRUE; ! wThread->sleepCountNow = reltim; ! } ! return E_OK; ! } ! ! void waba_call_run(INT thread_number) ! { ! Var params[7]; ! WClass *vclass; ! WClassMethod *runMethod; ! ! ! currentThread = &wThreadList[thread_number]; ! if (currentThread == NULL) ! { ! return; ! } ! ! vclass = currentThread->tClass; ! ! #ifdef QUICKBIND ! runMethod = getMethodByMapNum(vclass, &vclass, (uint16)wThreadList[threadProcessIndex].runMethodMapNum); ! #else ! runMethod = getMethod(vclass, createUtfString( "run" ), createUtfString( "()V" ), &vclass ); ! #endif ! ! if(runMethod != NULL) ! { ! params[0].obj = currentThread->tObject; ! executeMethod(vclass, runMethod, params, 1); ! } ! } ! ! ! int registerAsSyncronized(WClassMethod* method) ! { ! // Is the slot in the list available? ! if( (WClassMethod*)(currentThread->syncMethod) == (WClassMethod*)0xFFFFFFFF ) ! { ! // Then register the method ID into the slot. ! currentThread->syncMethod = method; ! } ! // Is this method locked out by another thread right now?. ! else if(currentThread->syncMethod != method) ! { ! // locked by another thread... ! return 0; ! } ! ! return 1; /* succeed */ ! } ! ! void exitFromSyncronized(WClassMethod* method) ! { ! if(currentThread->syncMethod == method) ! { ! (WClassMethod*)(currentThread->syncMethod) = (WClassMethod*)0xFFFFFFFF; ! } ! } ! ! ! int enterMonitor(WObject obj) ! { ! if(currentThread->syncObject == 0) ! { ! currentThread->syncObject = obj; ! } ! else ! { ! if(currentThread->syncObject != obj) ! return 0; ! } ! ! return 1; /* succeed */ ! } ! ! ! int exitMonitor(WObject obj) ! { ! if(currentThread->syncObject == obj) ! { ! currentThread->syncObject = 0; ! } ! else ! { ! if(currentThread->syncObject != obj) ! return 0; ! } ! ! return 1; /* succeed */ } *************** *** 346,478 **** } - // call onPaint method in MainWindow - static void drawMainWin() { - WObject mainWinObj; - WClass *vclass; - WClassMethod *method; - Var params[3]; - - mainWinObj = globalMainWin; - if (!mainWinObj) - return; - vclass = WOBJ_class(mainWinObj); // get runtime class - method = getMethod(vclass, createUtfString("_doPaint"), - createUtfString("()V"), &vclass); - if (method == NULL) - return; - params[0].obj = mainWinObj; - executeMethod(vclass, method, params, 1); - } - - #ifdef QUICKBIND - static int32 postEventMethodMapNum = -1; - static int32 onTimerTickMethodMapNum = -1; - #endif - - static int32 getTimeStamp() { - SYSTIM pk_systim; - syscall(get_tim(&pk_systim)); - return pk_systim; - } - - int32 globalTimerStart; - int32 globalTimerInterval = 0; - - // check timer interval - static void timerCheck() { - WObject mainWinObj; - WClass *vclass; - WClassMethod *method; - Var params[1]; - int32 now ; - int32 diff; - int32 timeout; - - mainWinObj = globalMainWin; - if (!mainWinObj) return; - - now = getTimeStamp(); - diff = now - globalTimerStart; - //if ( diff < 0 ) { - // diff += (1L << 30); - //} - timeout = globalTimerInterval - diff; - if ( timeout > 0 ) return; - - vclass = WOBJ_class(mainWinObj); // get runtime class - #ifdef QUICKBIND - method = getMethodByMapNum(vclass, &vclass, - (uint16)onTimerTickMethodMapNum); - #else - method = getMethod(vclass, createUtfString("_onTimerTick"), - createUtfString("()V"), &vclass); - #endif - if (method != NULL) { - params[0].obj = mainWinObj; - executeMethod(vclass, method, params, 1); - } - globalTimerStart = now; - } - - // call postEvent method - static void postKeyPress(int32 keyCode) { - WObject mainWinObj; - WClass *vclass; - WClassMethod *method; - Var params[7]; - mainWinObj = globalMainWin; - vclass = WOBJ_class(mainWinObj); // get runtime class - #ifdef QUICKBIND - method = getMethodByMapNum(vclass, &vclass, - (uint16)postEventMethodMapNum); - #else - method = getMethod(vclass, createUtfString("_postEvent"), - createUtfString("(IIIIII)V"), &vclass); - #endif - if (method != NULL) { - params[0].obj = mainWinObj; - params[1].intValue = 100; // type - params[2].intValue = keyCode; // key - params[3].intValue = 0; // x - params[4].intValue = 0; // y - params[5].intValue = 0; // modifiers - params[6].intValue = 0; // timeStamp - executeMethod(vclass, method, params, 7); - } - } - - #if 0 - #define KEY_FILER 1 - #define KEY_MENU 2 - #define KEY_ENTER 8 - #define KEY_LEFT 16 - #define KEY_UP 32 - #define KEY_RIGHT 64 - #define KEY_DOWN 128 - - static void handleKeyPress(int key) { - if ( (key&KEY_MENU) == KEY_MENU ) { - postKeyPress(75014); - } - if ( (key&KEY_ENTER) == KEY_ENTER ) { - postKeyPress(75009); - } - if ( (key&KEY_LEFT) == KEY_LEFT ) { - postKeyPress(75006); - } - if ( (key&KEY_UP) == KEY_UP ) { - postKeyPress(75004); - } - if ( (key&KEY_RIGHT) == KEY_RIGHT ) { - postKeyPress(75007); - } - if ( (key&KEY_DOWN) == KEY_DOWN ) { - postKeyPress(75005); - } - } - #endif - - int mainWinExit = 0; - // VM init & start int WabaMain(void) --- 530,533 ---- *************** *** 490,493 **** --- 545,550 ---- char *className = "MainMain"; WObject mainWinObj; + char *argv[0]; + static char arg[] = "\0"; #ifdef WITH_THREAD *************** *** 506,569 **** initClassInformation(); VmInit(vmStackSize, nmStackSize, classHeapSize, objectHeapSize); - mainWinObj = VmStartApp(className); - #ifdef QUICKBIND - if (mainWinObj != 0) - { - WClass *vclass; - - // cache method map numbers for commonly called methods - vclass = WOBJ_class(mainWinObj); - postEventMethodMapNum = getMethodMapNum(vclass, createUtfString("_postEvent"), - createUtfString("(IIIIII)V"), SEARCH_ALL); - onTimerTickMethodMapNum = getMethodMapNum(vclass, createUtfString("_onTimerTick"), - createUtfString("()V"), SEARCH_ALL); - if (postEventMethodMapNum == -1 || - onTimerTickMethodMapNum == -1) - mainWinObj = 0; - } - #endif - if ( vmStatus.errNum == 0 ) - { - drawMainWin(); - } - - #ifdef WITH_THREAD - - while(mainWinObj && !isQuit) - { - if ( globalTimerInterval >= 0 ) - { - timerCheck(); - } - - // dly_tsk(1); ! if (threadListCurrentSize > 0) ! { ! if(wThreadList[threadProcessIndex].sleepCountNow < wThreadList[threadProcessIndex].sleepCountSet) // If sleep value is set... ! (wThreadList[threadProcessIndex].sleepCountNow)++; ! else ! { ! wThreadList[threadProcessIndex].isSleepCountAlreadySet = FALSE; ! wThreadList[threadProcessIndex].sleepCountNow = 0; ! ! vclass = wThreadList[threadProcessIndex].tClass; ! ! runMethod = getMethodByMapNum(vclass, &vclass, (uint16)wThreadList[threadProcessIndex].runMethodMapNum); ! ! if(runMethod != NULL) ! { ! params[0].obj = wThreadList[threadProcessIndex].tObject; ! executeMethod(vclass, runMethod, params, 1); ! } ! } ! ! if( (threadListCurrentSize-1) > threadProcessIndex ) ! threadProcessIndex++; ! else ! threadProcessIndex = 0; ! } ! } ! #endif if ( vmStatus.errNum != 0 ) --- 563,569 ---- initClassInformation(); VmInit(vmStackSize, nmStackSize, classHeapSize, objectHeapSize); ! argv[0] = &arg[0]; ! VmStartApplication(className, 0, argv); if ( vmStatus.errNum != 0 ) *************** *** 572,577 **** } - VmStopApp(mainWinObj); - return 0; } --- 572,575 ---- |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:27:27
|
Update of /cvsroot/waba/waba/vm/toppers In directory usw-pr-cvs1:/tmp/cvs-serv23863 Modified Files: Tag: WABAJTRON-branch nmtoppers_b.h Log Message: Added extern symbol for function definition. Index: nmtoppers_b.h =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_b.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** nmtoppers_b.h 2001/09/02 05:25:49 1.1.2.2 --- nmtoppers_b.h 2001/09/02 05:27:25 1.1.2.3 *************** *** 40,63 **** //*** This "_onThreadStart()" method is called from "start()" method. ! Var ThreadStart(Var stack[]); //*** This "_onThreadStop()" method is called from "stop()" method. ! Var ThreadStop(Var stack[]); //*** This "_onThreadSleep()" method is called from "sleep()" method. ! Var ThreadSleep(Var stack[]); //*** This "_onThreadWait()" method is called from "wait()" method. ! Var ThreadWaitForSignal(Var stack[]); ! Var ThreadSignalAll(Var stack[]); //*** Isao's Multithread implementation END *** ! void tickThread(void); ! int registerAsSyncronized(WClassMethod* method); ! void exitFromSyncronized(WClassMethod* method); ! int enterMonitor(WObject obj); ! int exitMonitor(WObject obj); --- 40,63 ---- //*** This "_onThreadStart()" method is called from "start()" method. ! extern Var ThreadStart(Var stack[]); //*** This "_onThreadStop()" method is called from "stop()" method. ! extern Var ThreadStop(Var stack[]); //*** This "_onThreadSleep()" method is called from "sleep()" method. ! extern Var ThreadSleep(Var stack[]); //*** This "_onThreadWait()" method is called from "wait()" method. ! extern Var ThreadWaitForSignal(Var stack[]); ! extern Var ThreadSignalAll(Var stack[]); //*** Isao's Multithread implementation END *** ! extern void tickThread(void); ! extern int registerAsSyncronized(WClassMethod* method); ! extern void exitFromSyncronized(WClassMethod* method); ! extern int enterMonitor(WObject obj); ! extern int exitMonitor(WObject obj); |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:25:53
|
Update of /cvsroot/waba/waba/vm/toppers In directory usw-pr-cvs1:/tmp/cvs-serv23600 Modified Files: Tag: WABAJTRON-branch nmtoppers_b.h Log Message: Added thread_id and itron_tskid into WThread. Index: nmtoppers_b.h =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/nmtoppers_b.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** nmtoppers_b.h 2001/08/13 13:42:37 1.1.2.1 --- nmtoppers_b.h 2001/09/02 05:25:49 1.1.2.2 *************** *** 1,32 **** #ifdef WITH_THREAD ! //*** Isao's Multithread implementation START *** ! // Thread variables - Isao F. Yamashita 07/25/2000 #define THREAD_LIST_MAX_SIZE 8 typedef struct { ! WClass* tClass; ! WObject tObject; ! WObject syncObject; ! WClassMethod* syncMethod; ! int32 runMethodMapNum; ! int32 syncMethodMapNum; ! uint32 sleepCountSet; ! uint32 sleepCountNow; ! uchar isSleepCountAlreadySet; ! uchar isWaiting; } WThread; ! WThread wThreadList[THREAD_LIST_MAX_SIZE]; ! uint32 threadListCurrentSize; ! uint32 threadProcessIndex; ! uint32 threadSynchMethodIndex; //*** This "_onThreadStart()" method is called from "start()" method. --- 1,41 ---- + #ifndef __NMTOPPERS_A_H__ + #define __NMTOPPERS_A_H__ #ifdef WITH_THREAD ! //*** Monaka's Multithread implemantasion ! //**** based on Isao's Multithread implementation ! #define THREAD_LIST_MAX_SIZE 8 + typedef struct _queue { + struct _queue *next; + struct _queue *prev; + } Queue; + typedef struct { ! Queue queue; /* 'Queue' must be first to use type cast trick. */ ! WClass* tClass; ! WObject tObject; ! WObject syncObject; ! WClassMethod* syncMethod; ! int32 runMethodMapNum; ! int32 syncMethodMapNum; ! uint32 sleepCountSet; ! uint32 sleepCountNow; ! uchar isSleepCountAlreadySet; ! uchar isWaiting; ! ! uint32 thread_id; ! uint32 itron_tskid; } WThread; ! int InitThread(uint32 stack_size); //*** This "_onThreadStart()" method is called from "start()" method. *************** *** 46,48 **** //*** Isao's Multithread implementation END *** ! #endif /* WITH_THREAD */ --- 55,66 ---- //*** Isao's Multithread implementation END *** ! void tickThread(void); ! int registerAsSyncronized(WClassMethod* method); ! void exitFromSyncronized(WClassMethod* method); ! int enterMonitor(WObject obj); ! int exitMonitor(WObject obj); ! ! ! #endif /* WITH_THREAD */ ! ! #endif /* __NMTOPPERS_A_H__ */ |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:12:43
|
Update of /cvsroot/waba/waba/vm/toppers In directory usw-pr-cvs1:/tmp/cvs-serv21891 Modified Files: Tag: WABAJTRON-branch Makefile.am Log Message: Added files for sjtron into noinst_HEADERS libnmwaba_a_SOURCES Index: Makefile.am =================================================================== RCS file: /cvsroot/waba/waba/vm/toppers/Attic/Makefile.am,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Makefile.am 2001/08/16 05:12:57 1.1.2.1 --- Makefile.am 2001/09/02 05:12:40 1.1.2.2 *************** *** 1,7 **** noinst_LIBRARIES = libnmwaba.a ! noinst_HEADERS = nmtoppers_a.h nmtoppers_b.h nmtoppers_c.h ! libnmwaba_a_SOURCES = nmtoppers_a.c nmtoppers_b.c nmtoppers_c.c ! CFLAGS=@CFLAGS@ @CC_DEFINE@ --- 1,8 ---- noinst_LIBRARIES = libnmwaba.a ! noinst_HEADERS = nmtoppers_a.h nmtoppers_b.h nmtoppers_c.h nmtoppers_sjtron_evtflg.h nmtoppers_sjtron_semaphore.h nmtoppers_sjtron_kernel.h nmtoppers_sjtron_task.h ! libnmwaba_a_SOURCES = nmtoppers_a.c nmtoppers_b.c nmtoppers_c.c nmtoppers_sjtron_evtflg.c nmtoppers_sjtron_semaphore.c nmtoppers_sjtron_kernel.c nmtoppers_sjtron_task.c ! ! CFLAGS=@CFLAGS@ @ITRON_CFLAGS@ @CC_DEFINE@ |
From: MURANAKA M. <mo...@us...> - 2001-09-02 05:08:21
|
Update of /cvsroot/waba/waba/vm/win32 In directory usw-pr-cvs1:/tmp/cvs-serv21315 Modified Files: Tag: WABAJTRON-branch nmwin32_b.c Log Message: Deleted AllocConsole for debug. Index: nmwin32_b.c =================================================================== RCS file: /cvsroot/waba/waba/vm/win32/nmwin32_b.c,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** nmwin32_b.c 2001/08/16 04:34:56 1.5.2.1 --- nmwin32_b.c 2001/09/02 05:08:17 1.5.2.2 *************** *** 89,94 **** v.obj = 0; - AllocConsole(); - //Checking to see if the same thread is already running or not. //(A sanity check) --- 89,92 ---- |