Author: greatlrd
Date: Sat Jan 13 13:39:12 2007
New Revision: 25436
URL:
http://svn.reactos.org/svn/reactos?rev=25436&view=rev
Log:
1. last move is done arm to From folder
2. remove some include in CpuToIntel.c file they are not longer need it.
Added:
trunk/rosapps/devutils/cputointel/From/ARM/
trunk/rosapps/devutils/cputointel/From/ARM/ARM.h (with props)
trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c (with props)
trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.h (with props)
trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c (with props)
Modified:
trunk/rosapps/devutils/cputointel/CpuToIntel.c
trunk/rosapps/devutils/cputointel/ImageLoader.c
trunk/rosapps/devutils/cputointel/cputointel.rbuild
trunk/rosapps/devutils/cputointel/misc.c
Modified: trunk/rosapps/devutils/cputointel/CpuToIntel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/CpuToI…
==============================================================================
--- trunk/rosapps/devutils/cputointel/CpuToIntel.c (original)
+++ trunk/rosapps/devutils/cputointel/CpuToIntel.c Sat Jan 13 13:39:12 2007
@@ -3,9 +3,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "ARM/ARM.h"
-#include "From/m68k/m68k.h"
-#include "From/PPC/PPC.h"
#include "misc.h"
int main(int argc, char * argv[])
Added: trunk/rosapps/devutils/cputointel/From/ARM/ARM.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/A…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/ARM/ARM.h (added)
+++ trunk/rosapps/devutils/cputointel/From/ARM/ARM.h Sat Jan 13 13:39:12 2007
@@ -1,0 +1,17 @@
+
+#include "../../misc.h"
+
+CPU_INT ARMBrain( CPU_BYTE *cpu_buffer,
+ CPU_UNINT cpu_pos,
+ CPU_UNINT cpu_size,
+ CPU_UNINT BaseAddress,
+ CPU_UNINT cpuarch,
+ FILE *outfp);
+
+/* here we put the prototype for the opcode api that brain need we show a example for it
*/
+CPU_INT ARM_(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
+
+
+/* Export comment thing see m68k for example
+ * in dummy we do not show it, for it is diffent for each cpu
+ */
Propchange: trunk/rosapps/devutils/cputointel/From/ARM/ARM.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/A…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c (added)
+++ trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c Sat Jan 13 13:39:12 2007
@@ -1,0 +1,72 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "ARMBrain.h"
+#include "ARM.h"
+#include "../../misc.h"
+
+/* retun
+ * 0 : Ok
+ * 1 : unimplemt
+ * 2 : Unkonwn Opcode
+ * 3 : unimplement cpu
+ * 4 : unknown machine
+ */
+
+CPU_INT ARMBrain( CPU_BYTE *cpu_buffer,
+ CPU_UNINT cpu_pos,
+ CPU_UNINT cpu_size,
+ CPU_UNINT BaseAddress,
+ CPU_UNINT cpuarch,
+ FILE *outfp)
+{
+ CPU_UNINT cpu_oldpos;
+ CPU_INT cpuint;
+ CPU_INT retcode = 0;
+ CPU_INT retsize;
+
+
+ /* now we start the process */
+ while (cpu_pos<cpu_size)
+ {
+ cpu_oldpos = cpu_pos;
+
+ cpuint = cpu_buffer[cpu_pos];
+
+ /* Add */
+ if ((cpuint - (cpuint & GetMaskByte32(cpuARMInit_))) ==
ConvertBitToByte32(cpuARMInit_))
+ {
+ retsize = ARM_( outfp, cpu_buffer, cpu_pos, cpu_size,
+ BaseAddress, cpuarch);
+ if (retsize<0)
+ retcode = 1;
+ else
+ cpu_pos += retsize;
+ }
+
+ /* Found all Opcode and breakout and return no error found */
+ if (cpu_pos >=cpu_size)
+ {
+ break;
+ }
+
+ /* Check if we have found a cpu opcode */
+ if (cpu_oldpos == cpu_pos)
+ {
+ if (retcode == 0)
+ {
+ /* no unimplement error where found so we return a msg for unknown opcode
*/
+ printf("Unkonwn Opcode found at 0x%8x opcode
0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
+ retcode = 2;
+ }
+ }
+
+ /* Erorro Found ? */
+ if (retcode!=0)
+ {
+ /* Erorro Found break and return the error code */
+ break;
+ }
+ }
+ return retcode;
+}
Propchange: trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/A…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.h (added)
+++ trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.h Sat Jan 13 13:39:12 2007
@@ -1,0 +1,12 @@
+
+#include "../../misc.h"
+
+
+/* example how setup a opcode, this opcode is 16bit long (taken from M68K)
+ * 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent
+ * thing in the opcode, example which reg so on, it can be etither 0 or 1 in
+ * the opcode. but a opcode have also normal bit that is always been set to
+ * same. thuse bit are always 0 or 1
+ */
+CPU_BYTE cpuARMInit_[32] =
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
+
Propchange: trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/A…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c (added)
+++ trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c Sat Jan 13 13:39:12 2007
@@ -1,0 +1,39 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "../../misc.h"
+
+
+/* cpuDummyInit_Add
+ * Input param :
+ * out : The file pointer that we write to (the output file to
intel asm)
+ * cpu_buffer : The memory buffer we have our binary code that we whant
convert
+ * cpu_pos : Current positions in the cpu_buffer
+ * cpu_size : The memory size of the cpu_buffer
+ * BaseAddress : The base address you whant the binay file should run from
+ * cpuarch : if it exists diffent cpu from a manufactor like pentium,
+ * pentinum-mmx so on, use this flag to specify which type
+ * of cpu you whant or do not use it if it does not exists
+ * other or any sub model.
+ *
+ * Return value :
+ * value -1 : unimplement
+ * value 0 : wrong opcode or not vaild opcode
+ * value +1 and higher : who many byte we should add to cpu_pos
+ */
+
+CPU_INT ARM_( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+
+{
+ /*
+ * ConvertBitToByte() is perfect to use to get the bit being in use from a bit array
+ * GetMaskByte() is perfect if u whant known which bit have been mask out
+ * see M68kopcode.c and how it use the ConvertBitToByte()
+ */
+
+ fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
+
+ printf(";Add unimplement\n");
+ return -1;
+}
Propchange: trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rosapps/devutils/cputointel/ImageLoader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/ImageL…
==============================================================================
--- trunk/rosapps/devutils/cputointel/ImageLoader.c (original)
+++ trunk/rosapps/devutils/cputointel/ImageLoader.c Sat Jan 13 13:39:12 2007
@@ -5,7 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include "misc.h"
-#include "ARM/ARM.h"
+#include "From/ARM/ARM.h"
#include "From/m68k/m68k.h"
#include "From/PPC/PPC.h"
Modified: trunk/rosapps/devutils/cputointel/cputointel.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/cputoi…
==============================================================================
--- trunk/rosapps/devutils/cputointel/cputointel.rbuild (original)
+++ trunk/rosapps/devutils/cputointel/cputointel.rbuild Sat Jan 13 13:39:12 2007
@@ -10,8 +10,8 @@
<file>ImageLoader.c</file>
<file>misc.c</file>
- <file>ARM/ARMBrain.c</file>
- <file>ARM/ARMopcode.c</file>
+ <file>From/ARM/ARMBrain.c</file>
+ <file>From/ARM/ARMopcode.c</file>
<file>From/m68k/M68kBrain.c</file>
<file>From/m68k/M68kopcode.c</file>
Modified: trunk/rosapps/devutils/cputointel/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/misc.c…
==============================================================================
--- trunk/rosapps/devutils/cputointel/misc.c (original)
+++ trunk/rosapps/devutils/cputointel/misc.c Sat Jan 13 13:39:12 2007
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include "misc.h"
-#include "ARM/ARM.h"
+#include "From/ARM/ARM.h"
#include "From/m68k/m68k.h"
#include "From/PPC/PPC.h"