├── arch ├── ppc │ ├── mach │ │ ├── skyeye_mach_mpc8548.c │ │ ├── Makefile │ │ ├── mpc8560.h │ │ ├── mpc8xx_mem.h │ │ └── skyeye_mach_mpc823.c │ └── common │ │ ├── types.h │ │ ├── debug.h │ │ ├── ppc_tools.h │ │ ├── snprintf.h │ │ ├── ppc_memory.h │ │ ├── ppc_io.h │ │ ├── ppc_io.c │ │ ├── ppc_e500_exc.h │ │ └── ppc_opc.h ├── arm │ ├── mach │ │ ├── lpc.h │ │ ├── imx-regs.h │ │ ├── otpdata.h │ │ ├── starlet.h │ │ ├── sa1100.h │ │ ├── cs89712.h │ │ └── lh79520.h │ ├── dbct │ │ ├── arm2x86_mul.h │ │ ├── arm2x86_test.h │ │ ├── arm2x86_self.h │ │ ├── arm2x86_coproc.h │ │ └── list.h │ └── common │ │ ├── mmu │ │ ├── arm7100_mmu.h │ │ ├── arm920t_mmu.h │ │ ├── arm926ejs_mmu.h │ │ ├── rb.h │ │ ├── wb.h │ │ └── sa_mmu.h │ │ ├── armengr.h │ │ └── armio.h ├── coldfire │ ├── i_5206 │ │ ├── convert.sh │ │ ├── Makefile │ │ ├── i_illegal.c │ │ ├── i_nop.c │ │ ├── i_dc.c │ │ ├── i_rte.c │ │ ├── i_rts.c │ │ ├── i_trap.c │ │ ├── i_halt.c │ │ ├── i_neg.c │ │ ├── i_negx.c │ │ ├── i_jmp.c │ │ ├── i_not.c │ │ ├── i_pea.c │ │ ├── i_stop.c │ │ ├── i_jsr.c │ │ ├── i_unlk.c │ │ ├── i_addi.c │ │ ├── i_subx.c │ │ ├── i_lea.c │ │ ├── i_cmp.c │ │ ├── i_adda.c │ │ ├── i_addx.c │ │ ├── i_swap.c │ │ ├── i_cmpa.c │ │ ├── i_moveq.c │ │ ├── temp │ │ ├── i_suba.c │ │ ├── i_eori.c │ │ ├── i_5206.h │ │ ├── i_cmpi.c │ │ ├── i_ori.c │ │ ├── i_subi.c │ │ └── i_clr.c │ ├── tracer │ │ ├── README │ │ ├── mktracech.sh │ │ ├── Makefile │ │ ├── generated.channels.h │ │ ├── main.c │ │ └── tracer.h │ ├── Makefile │ ├── common │ │ ├── Makefile │ │ ├── addressing.h │ │ └── cycle.c │ └── mach │ │ └── mcf5249.h ├── bfin │ ├── common │ │ ├── bfin_io.h │ │ ├── iomem.h │ │ ├── mach.h │ │ ├── un-syscall.h │ │ ├── syscall.h │ │ ├── types.h │ │ ├── dma.h │ │ └── mem_map.h │ └── mach │ │ └── bf533_irq.h └── mips │ └── common │ ├── interrupt.c │ ├── cache.c │ ├── types.h │ ├── mipsdef.h │ └── multiply.c ├── ipc ├── .gitignore ├── show.py ├── launchbc.py ├── shell.py ├── launchios.py └── importboot.py ├── .gitignore ├── device ├── net │ └── dev_net_rtl8019.h ├── flash │ ├── armflash.h │ └── skyeye_flash.h ├── touchscreen │ └── skyeye_touchscreen.h ├── uart │ └── skyeye_uart_net.c ├── lcd │ ├── dev_lcd_ep7312.h │ ├── dev_lcd_pxa.h │ ├── dev_lcd_s3c44b0x.h │ └── dev_lcd_s3c2410.h ├── nandflash │ ├── dev_nandflash_s3c2410.h │ ├── dev_nandflash_starlet.h │ ├── nandflash_largeblock.h │ ├── nandflash_smallblock.h │ └── tools │ │ └── mknandflashdump.c └── sound │ └── skyeye_sound.h ├── dbct ├── include │ ├── i386_reg.h │ ├── host_reg.h │ ├── reg_map.h │ └── target_reg.h ├── host │ └── i386_reg.h └── oplet │ ├── Makefile │ ├── reg_gen.c │ └── movl_gen.c ├── misc ├── auto_test │ ├── README.daily │ ├── exec_skyeye.sh │ ├── exec_skyeye_dbct.sh │ ├── README │ ├── daily_test.sh │ └── auto_test ├── linux_driver │ └── rtl8019 │ │ └── README ├── uClinux │ └── uClinux-dist-20040408-lpc.diff ├── gdb │ └── README └── conf │ ├── configs │ └── mkdefconfig │ └── scripts │ └── lxdialog │ └── makefile.lx ├── REPORTING-BUGS ├── utils ├── portable │ ├── beos │ │ ├── stdint.h │ │ ├── usleep.c │ │ └── tap_driver │ │ │ ├── Makefile │ │ │ └── skyeye_tap.h │ ├── gettimeofday.c │ ├── usleep.c │ ├── usleep.h │ ├── win32 │ │ ├── usleep.c │ │ ├── gettimeofday.c │ │ └── mman.c │ ├── gettimeofday.h │ └── mman.h ├── scripts │ ├── check-gcc.sh │ ├── check-bfd.sh │ ├── check-x86-asm.sh │ └── check-bigendian.sh ├── config │ ├── skyeye_arch.h │ ├── skyeye_types.h │ ├── skyeye_defs.h │ ├── skyeye_arch.c │ └── skyeye_options.h └── main │ └── setup.py ├── TODO ├── skyeye.conf ├── MAINTAINERS └── LICENSE /arch/ppc/mach/skyeye_mach_mpc8548.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ipc/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.bin 3 | *.elf 4 | *.pyc 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | binary 2 | *.bin 3 | nand-key 4 | *~ 5 | *.o 6 | -------------------------------------------------------------------------------- /arch/arm/mach/lpc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcan/skyeye-starlet/HEAD/arch/arm/mach/lpc.h -------------------------------------------------------------------------------- /arch/arm/mach/imx-regs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcan/skyeye-starlet/HEAD/arch/arm/mach/imx-regs.h -------------------------------------------------------------------------------- /device/net/dev_net_rtl8019.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcan/skyeye-starlet/HEAD/device/net/dev_net_rtl8019.h -------------------------------------------------------------------------------- /dbct/include/i386_reg.h: -------------------------------------------------------------------------------- 1 | struct _reg_s i386_regs[] = { 2 | {"T0", "ebx"}, 3 | {"T1", "esi"}, 4 | {"T2", "edi"} 5 | }; 6 | -------------------------------------------------------------------------------- /misc/auto_test/README.daily: -------------------------------------------------------------------------------- 1 | set the two variables(TESTSUITE_PATH,DEVELOPER_NAME) to correct values and run daily_test.sh 2 | -------------------------------------------------------------------------------- /dbct/include/host_reg.h: -------------------------------------------------------------------------------- 1 | #include 2 | reg_t host_regs[] = { 3 | {"T0", "ebx"}, 4 | {"T1", "esi"}, 5 | {"T2", "edi"} 6 | }; 7 | -------------------------------------------------------------------------------- /misc/linux_driver/rtl8019/README: -------------------------------------------------------------------------------- 1 | The patch is tested on linux-2.4.x source tree of uClinux-dist-2000408 and uClinux-dist-20070130 version. 2 | -------------------------------------------------------------------------------- /misc/uClinux/uClinux-dist-20040408-lpc.diff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcan/skyeye-starlet/HEAD/misc/uClinux/uClinux-dist-20040408-lpc.diff -------------------------------------------------------------------------------- /arch/coldfire/i_5206/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | for i in `find ./ -name "*.c"` 3 | do 4 | sed '/TRACE/d' $i > temp 5 | cp temp $i 6 | done 7 | -------------------------------------------------------------------------------- /REPORTING-BUGS: -------------------------------------------------------------------------------- 1 | Please report bug in the following URL: 2 | 3 | http://sourceforge.net/tracker/?group_id=85554&atid=576533 4 | 5 | -- Thank you 6 | -------------------------------------------------------------------------------- /arch/ppc/mach/Makefile: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE ?= 2 | EXTRA_CFLAGS ?= 3 | 4 | CC ?= $(CROSS_COMPILE)gcc 5 | CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS) 6 | 7 | all: 8 | 9 | clean: 10 | 11 | -------------------------------------------------------------------------------- /dbct/host/i386_reg.h: -------------------------------------------------------------------------------- 1 | struct _reg_s{ 2 | char * ir_regname 3 | char * regname; 4 | } 5 | struct i386_reg = { 6 | {"T0", "ebx"}, 7 | {"T1", "esi"}, 8 | {"T2", "edi"} 9 | }; 10 | -------------------------------------------------------------------------------- /ipc/show.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys, time 4 | from ipc import * 5 | 6 | ipc = SkyeyeIPC() 7 | 8 | while True: 9 | print "============================================================================" 10 | ipc.getstate().show() 11 | time.sleep(0.01) 12 | -------------------------------------------------------------------------------- /arch/bfin/common/bfin_io.h: -------------------------------------------------------------------------------- 1 | #include "types.h" 2 | bu8 io_read_byte (bu32 addr); 3 | bu16 io_read_word (bu32 addr); 4 | bu32 io_read_long (bu32 addr); 5 | void io_write_byte (bu32 addr, bu8 v); 6 | void io_write_word (bu32 addr, bu16 v); 7 | void io_write_long (bu32 addr, bu32 v); 8 | -------------------------------------------------------------------------------- /arch/coldfire/tracer/README: -------------------------------------------------------------------------------- 1 | Notes: 2 | - The tracer subdir should be the first one build in a 'make'. 3 | It generates the channel header file, which is needed by tracer.h. 4 | - Delete the generated.channels.h file if you add a channel, and 5 | rebuild _everything_. Some channel numbers could have changed. 6 | 7 | -------------------------------------------------------------------------------- /utils/portable/beos/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef __SKYEYE_PORTABLE_BEOS_STDINT_H_ 2 | #define __SKYEYE_PORTABLE_BEOS_STDINT_H_ 3 | 4 | #include 5 | #include 6 | 7 | #ifndef INT32_MAX 8 | #define INT32_MAX INT_MAX 9 | #endif /* INT32_MAX */ 10 | 11 | #endif /* __SKYEYE_PORTABLE_BEOS_STDINT_H_*/ 12 | 13 | -------------------------------------------------------------------------------- /dbct/oplet/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-I$(PWD)/../include 2 | all: reg_gen movl_gen shift_gen 3 | reg_gen:reg_gen.c 4 | gcc $(CFLAGS) -o reg_gen reg_gen.c 5 | movl_gen:movl_gen.c 6 | gcc $(CFLAGS) -o movl_gen movl_gen.c 7 | shift_gen:shift_gen.c 8 | gcc $(CFLAGS) -o shift_gen shift_gen.c 9 | clean: 10 | rm -f reg_gen movl_gen shift_gen 11 | -------------------------------------------------------------------------------- /dbct/include/reg_map.h: -------------------------------------------------------------------------------- 1 | #ifndef __REG_MAP_H__ 2 | #define __REG_MAP_H__ 3 | 4 | struct _reg_s { 5 | char * ir_regname; 6 | char * host_regname; 7 | }; 8 | typedef struct _reg_s reg_t; 9 | 10 | struct _target_reg_s { 11 | char * regname; 12 | char * regvalue; 13 | }; 14 | typedef struct _target_reg_s target_reg_t; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /arch/coldfire/Makefile: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE ?= 2 | EXTRA_CFLAGS ?= 3 | 4 | SUBDIRS = i_5206 tracer common 5 | 6 | all: 7 | for f in $(SUBDIRS); do \ 8 | $(MAKE) -C $$f EXTRA_CFLAGS="$(EXTRA_CFLAGS)" CROSS_COMPILE=$(CROSS_COMPILE); \ 9 | done 10 | 11 | clean: 12 | for f in $(SUBDIRS); do \ 13 | $(MAKE) -C $$f clean; \ 14 | done 15 | rm -f tags 16 | -------------------------------------------------------------------------------- /arch/mips/common/interrupt.c: -------------------------------------------------------------------------------- 1 | #include "emul.h" 2 | 3 | /* Deliver external events. The (events) bitset is consulted synchronously at 4 | * appropriate places in the fetch-execute loop. 5 | */ 6 | 7 | void deliver_cold_reset(MIPS_State* mstate) 8 | { 9 | mstate->events |= cold_reset_event; 10 | } 11 | 12 | void deliver_soft_reset(MIPS_State* mstate) 13 | { 14 | mstate->events |= soft_reset_event; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /dbct/oplet/reg_gen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | int main(){ 6 | char * filename = "reg_defs.h"; 7 | FILE * fd = fopen(filename, "w+"); 8 | int i = 0; 9 | for(; i < sizeof(host_regs)/sizeof(reg_t) ;i++){ 10 | fprintf(fd, "register uint32_t %s asm (\"%s\")\n", host_regs[i].ir_regname, host_regs[i].host_regname); 11 | } 12 | close(fd); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /arch/bfin/common/iomem.h: -------------------------------------------------------------------------------- 1 | #ifndef __BFIN_IOMEM_H 2 | #define __BFIN_IOMEM_H 3 | #include "types.h" 4 | void put_byte (unsigned char *memory, bu32 addr, bu8 v); 5 | void put_word (unsigned char *memory, bu32 addr, bu16 v); 6 | void put_long (unsigned char *memory, bu32 addr, bu32 v); 7 | bu8 get_byte (unsigned char *memory, bu32 addr); 8 | bu16 get_word (unsigned char *memory, bu32 addr); 9 | bu32 get_long (unsigned char *memory, bu32 addr); 10 | #endif 11 | -------------------------------------------------------------------------------- /arch/ppc/mach/mpc8560.h: -------------------------------------------------------------------------------- 1 | #ifndef __MPC8560_H__ 2 | #define __MPC8560_H__ 3 | #define PCI_TARGET_CODE 0b0000 4 | #define LOCAL_BUS_TARGET_CODE 0b0100 5 | #define RAPID_IO_TARGET_CODE 0b1100 6 | #define DDR_SDRAM_TARGET_CODE 0b1111 7 | #endif 8 | #ifndef __MPC8560_H__ 9 | #define __MPC8560_H__ 10 | #define PCI_TARGET_CODE 0b0000 11 | #define LOCAL_BUS_TARGET_CODE 0b0100 12 | #define RAPID_IO_TARGET_CODE 0b1100 13 | #define DDR_SDRAM_TARGET_CODE 0b1111 14 | #endif 15 | -------------------------------------------------------------------------------- /arch/coldfire/tracer/mktracech.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Arg 1: Directory to start search in 3 | # We always output to current directory 4 | 5 | outfile="generated.channels.h" 6 | 7 | echo "/* We define TRACER_DECLARE(ch) so we can use this list more than once */" > $outfile 8 | 9 | find $1 -name \*.c -exec cat {} \; \ 10 | | grep TRACER_DEFAULT_CHANNEL\ 11 | | sed -e "s/TRACER_DEFAULT_CHANNEL/TRACER_DECLARE/"\ 12 | | sed -e "s/;.*$//" | sort | uniq >> $outfile 13 | -------------------------------------------------------------------------------- /device/flash/armflash.h: -------------------------------------------------------------------------------- 1 | //ywc 2005-1-21 for flash simulation 2 | ARMword flash_read_byte (ARMul_State * state, ARMword addr); 3 | void flash_write_byte (ARMul_State * state, ARMword addr, ARMword data); 4 | ARMword flash_read_halfword (ARMul_State * state, ARMword addr); 5 | void flash_write_halfword (ARMul_State * state, ARMword addr, ARMword data); 6 | ARMword flash_read_word (ARMul_State * state, ARMword addr); 7 | void flash_write_word (ARMul_State * state, ARMword addr, ARMword data); 8 | -------------------------------------------------------------------------------- /arch/arm/mach/otpdata.h: -------------------------------------------------------------------------------- 1 | unsigned int otp_data[] = { 2 | 0xEF3EF781, 0x09608D56, 0xDF5679A6, 0xF92E13F7, 3 | 0x8BBDDFDF, 0xEBE42A22, 0x5E8593E4, 0x48D9C545, 4 | 0x7381AAF7, 0x0414B6E3, 0x01D38CD7, 0x022CB480, 5 | 0x94D20237, 0x70E80615, 0xB57D66CF, 0x647E9D76, 6 | 0x42D79EF1, 0x78887852, 0xFF9343BC, 0xDE754D68, 7 | 0x0780F307, 0x253FEBB4, 0xDB83FD5F, 0xE03599DA, 8 | 0xA45E281A, 0x6B8C20A6, 0x2B071BDE, 0x940823FA, 9 | 0x5B8A05E9, 0xCD304677, 0x48A88E66, 0x00000007 10 | }; 11 | -------------------------------------------------------------------------------- /misc/auto_test/exec_skyeye.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | cd "$1" 3 | skyeye_path="$2" 4 | 5 | if test "x$OSTYPE" == "xmsys" || test "x$TERM" == "xcygwin"; then 6 | SKYEYE="${skyeye_path}/skyeye.exe" 7 | else 8 | SKYEYE="${skyeye_path}/skyeye" 9 | fi 10 | 11 | test -e linux && "$SKYEYE" -e linux -c skyeye.conf 12 | test -e vmlinux && "$SKYEYE" -e vmlinux -c skyeye.conf 13 | test -e vmlinux.large && "$SKYEYE" -e vmlinux.large -c skyeye.conf 14 | test -e vmlinux-8-332 && "$SKYEYE" -e vmlinux-8-332 -c skyeye.conf 15 | 16 | -------------------------------------------------------------------------------- /misc/auto_test/exec_skyeye_dbct.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | cd "$1" 3 | skyeye_path="$2" 4 | 5 | if test "x$OSTYPE" == "xmsys" || test "x$TERM" == "xcygwin"; then 6 | SKYEYE="${skyeye_path}/skyeye.exe" 7 | else 8 | SKYEYE="${skyeye_path}/skyeye" 9 | fi 10 | 11 | test -e linux && "$SKYEYE" -e linux -c skyeye_dbct.conf 12 | test -e vmlinux && "$SKYEYE" -e vmlinux -c skyeye_dbct.conf 13 | test -e vmlinux.large && "$SKYEYE" -e vmlinux.large -c skyeye_dbct.conf 14 | test -e vmlinux-8-332 && "$SKYEYE" -e vmlinux-8-332 -c skyeye_dbct.conf 15 | 16 | -------------------------------------------------------------------------------- /dbct/include/target_reg.h: -------------------------------------------------------------------------------- 1 | #include "reg_map.h" 2 | 3 | target_reg_t target_regs[] = { 4 | {"r0", "st->Reg[0]"}, 5 | {"r1", "st->Reg[1]"}, 6 | {"r2", "st->Reg[2]"}, 7 | {"r3", "st->Reg[3]"}, 8 | {"r4", "st->Reg[4]"}, 9 | {"r5", "st->Reg[5]"}, 10 | {"r6", "st->Reg[6]"}, 11 | {"r7", "st->Reg[7]"}, 12 | {"r8", "st->Reg[8]"}, 13 | {"r9", "st->Reg[9]"}, 14 | {"r10", "st->Reg[10]"}, 15 | {"r11", "st->Reg[11]"}, 16 | {"r12", "st->Reg[12]"}, 17 | {"r13", "st->Reg[13]"}, 18 | {"r14", "st->Reg[14]"}, 19 | {"r15", "st->Reg[15]"}, 20 | }; 21 | -------------------------------------------------------------------------------- /arch/ppc/mach/mpc8xx_mem.h: -------------------------------------------------------------------------------- 1 | #define CS0 (0) 2 | #define CS1 (1) 3 | #define CS2 (2) 4 | #define CS3 (3) 5 | #define CS4 (4) 6 | #define CS5 (5) 7 | #define CS6 (6) 8 | #define CS7 (7) 9 | 10 | #define SPR_IMMR (638) 11 | /* Internal space base */ 12 | #define IMMR_ISB(immr) ((immr) & 0xffff0000); 13 | #define IMMR_PARTNUM(immr) (((immr)&0xff00)>>8) 14 | #define IMMR_MASKNUM(immr) (((immr)&0xff)) 15 | typedef struct MPC8xx_MemCo MPC8xx_MemCo; 16 | 17 | MPC8xx_MemCo * MPC8xx_MemController_New(); 18 | void MPC8xx_RegisterDevice(MPC8xx_MemCo *memco,BusDevice *bdev,uint32_t cs); 19 | -------------------------------------------------------------------------------- /ipc/launchbc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from ipc import * 5 | 6 | print "Waiting for IPC to start up..." 7 | ipc = SkyeyeIPC() 8 | ipc.init() 9 | print "IPC ready" 10 | 11 | fd = ipc.IOSOpen("/dev/es") 12 | print "ES fd: %d"%fd 13 | if fd < 0: 14 | print "Error opening ES" 15 | sys.exit(1) 16 | 17 | print "Launching..." 18 | 19 | launchres = IOSIoctlv(fd, 0x25, "") 20 | ipc.clearack() 21 | ipc.async(launchres) 22 | 23 | print "Waiting for PPC..." 24 | 25 | ipc.waitppc(0) 26 | print "PPC dead" 27 | ipc.waitppc(1) 28 | print "PPC alive" 29 | ipc.exit() 30 | -------------------------------------------------------------------------------- /arch/arm/mach/starlet.h: -------------------------------------------------------------------------------- 1 | /************************************************************************/ 2 | /* STARLET Special Function Register Definition */ 3 | /************************************************************************/ 4 | 5 | #ifndef __STARLET_H__ 6 | #define __STARLET_H__ 7 | 8 | #define REGBASE 0x0D800000 9 | #define REGL(addr) (REGBASE+addr) 10 | #define REGW(addr) (REGBASE+addr) 11 | #define REGB(addr) (REGBASE+addr) 12 | 13 | #define INT_NAND 0x01 14 | #define INT_POWER 0x0b 15 | #define INT_RESET 0x11 16 | 17 | #endif /*__STARLET_H___*/ 18 | 19 | -------------------------------------------------------------------------------- /arch/bfin/common/mach.h: -------------------------------------------------------------------------------- 1 | #ifndef MACH_H 2 | #define MACH_H 3 | #include "types.h" 4 | typedef struct mach 5 | { 6 | bu8 (*io_read_byte) (bu32 addr); 7 | bu16 (*io_read_word) (bu32 addr); 8 | bu32 (*io_read_long) (bu32 addr); 9 | void (*io_write_byte) (bu32 addr, bu8 v); 10 | void (*io_write_word) (bu32 addr, bu16 v); 11 | void (*io_write_long) (bu32 addr, bu32 v); 12 | void (*io_do_cycle) (void); 13 | void (*clear_int) (bu32 irq); 14 | void (*set_int) (bu32 irq); 15 | void (*disable_int) (); 16 | void (*enable_int) (); 17 | void (*sti) (bu32 dreg); 18 | void (*cli) (bu32 dreg); 19 | } mach_t; 20 | #endif 21 | -------------------------------------------------------------------------------- /misc/auto_test/README: -------------------------------------------------------------------------------- 1 | autotest Version 0.2 2 | Author: Kang Shuo, Chen Yu 3 | Description : AutoTest all the testcase in SkyEye testsuite. 4 | Usage: 5 | 0 get skyeye source, compile it and get skyeye binary code. 6 | 1 place daily_test.sh, auto_test, exec_skyeye.sh, exec_skyeye_dbct.sh, skyeye binary code into testsuite2 directoy 7 | 2 cd testsuite2 directory, run ./auto_test. You can select testcases by modify path variable in auto_test script. 8 | 9 | NOTE: 10 | if you can cvs co skyeye-v1, then just edit daily_test.sh and set the two variables(TESTSUITE_PATH,DEVELOPER_NAME) to fit your environment and run daily_test.sh 11 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | known issue: 2 | --------------------- 3 | gdb remote debug is not stable 4 | type very slow in several testcases 5 | 6 | short term: 7 | ---------- 8 | - improve the auto test framework to test network , lcd, flash etc. 9 | - mips simulation 10 | - x86 simulation 11 | - ppc simulation 12 | 13 | long term: 14 | ------------ 15 | - mutilple thread implementation in simualtion 16 | - a common dynamic translation framework for arm and blackfin 17 | 18 | lower priority: 19 | -------------- 20 | - skyeye.conf in XML format 21 | - GUI config program for skyeye.conf 22 | - improve speed of skyeye simulation 23 | - performace test of skyeye simulation, maybe nbench-byte? 24 | -------------------------------------------------------------------------------- /arch/coldfire/tracer/Makefile: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE ?= 2 | EXTRA_CFLAGS ?= 3 | 4 | TOPSRCDIR = .. 5 | BUILD = tracer.o 6 | C_SRCS = main.c 7 | 8 | 9 | CC ?= $(CROSS_COMPILE)gcc 10 | CFLAGS = -Wall -fomit-frame-pointer -g -O2 -I$(TOPSRCDIR) $(EXTRA_CFLAGS) 11 | 12 | LD_R = $(CROSS_COMPILE)ld -r 13 | RM = rm -f 14 | LDFLAGS = 15 | 16 | OBJS = $(C_SRCS:.c=.o) 17 | 18 | all: $(BUILD) 19 | 20 | .c.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | $(RM) $(OBJS) $(BUILD) 25 | 26 | generated.channels.h: 27 | ./mktracech.sh .. 28 | 29 | distclean: 30 | $(RM) generated.channels.h 31 | 32 | $(BUILD): generated.channels.h $(OBJS) 33 | $(LD_R) $(OBJS) -o $@ 34 | 35 | # Deps 36 | tracer.o: generated.channels.h main.c tracer.h 37 | 38 | -------------------------------------------------------------------------------- /arch/coldfire/common/Makefile: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE ?= 2 | EXTRA_CFLAGS ?= 3 | 4 | CC ?= $(CROSS_COMPILE)gcc -g 5 | CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS) 6 | 7 | coldfire:memory.o addressing.o i.o cycle.o handlers.o exception.o ../tracer/tracer.o board.o ram.o 8 | memory.o:memory.c 9 | $(CC) $(CFLAGS) -c -I../tracer memory.c 10 | addressing.o:addressing.c 11 | $(CC) $(CFLAGS) -c -I../tracer addressing.c 12 | i.o:i.c 13 | $(CC) $(CFLAGS) -c -I../tracer i.c 14 | cycle.o:cycle.c 15 | $(CC) $(CFLAGS) -c -I../tracer cycle.c 16 | handlers.o:handlers.c 17 | $(CC) $(CFLAGS) -c -I../tracer handlers.c 18 | exception.o:exception.c 19 | $(CC) $(CFLAGS) -c -I../tracer exception.c 20 | board.o:board.c 21 | $(CC) $(CFLAGS) -c -I../tracer board.c 22 | ram.o:ram.c 23 | $(CC) $(CFLAGS) -c -I../tracer ram.c 24 | clean: 25 | rm -f *.o 26 | -------------------------------------------------------------------------------- /utils/scripts/check-gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Written by Anthony Lee 2007.03 4 | # 5 | 6 | printf "Checking gcc ... " 7 | 8 | case $CC in 9 | *gcc*) 10 | ;; 11 | *) 12 | printf "IGNORE\n" 13 | exit 0 14 | ;; 15 | esac 16 | 17 | if ( $CC -dumpversion > /dev/null 2>&1 ); then 18 | GCC_VERSION=`$CC -dumpversion` 19 | elif ( $CC --version > /dev/null 2>&1 ); then 20 | GCC_VERSION=`$CC --version` 21 | else 22 | GCC_VERSION=unknown 23 | fi 24 | 25 | case $GCC_VERSION in 26 | unknown|2.*) 27 | printf "FAILED\n\n" 28 | printf "*** You are using $CC, version $GCC_VERSION .\n" 29 | printf "*** To perform the compilation, we need gcc >= 3.x.x !!!\n" 30 | printf "*** Run \"make NO_GCC_CHECK=1\" instead to ignore it.\n\n" 31 | exit 1 32 | ;; 33 | *) 34 | printf "OK ( `basename $CC` version: $GCC_VERSION )\n" 35 | exit 0 36 | ;; 37 | esac 38 | 39 | -------------------------------------------------------------------------------- /arch/mips/common/cache.c: -------------------------------------------------------------------------------- 1 | #include "instr.h" 2 | #include "emul.h" 3 | 4 | int 5 | decode_cache(MIPS_State* mstate, Instr instr) //Use in Cache Instruction, it's unuseable in R3000 6 | { 7 | // CP0 is usable in kernel mode or when the CU bit in SR is set. 8 | if (!(mstate->mode & kmode) && !bit(mstate->cp0[SR], SR_CU0)) 9 | process_coprocessor_unusable(mstate, 0); 10 | 11 | VA va = sign_extend_UInt32(offset(instr), 16) + mstate->gpr[base(instr)]; 12 | PA pa = translate_vaddr(mstate, va, cache_op); 13 | if (pa != bad_pa) { 14 | if (bit(instr, 16)) { 15 | // Control data cache. 16 | control_dcache(mstate, va, pa, bits(instr, 20, 18), bit(instr, 17)); 17 | } else { 18 | // Control instruction cache. 19 | control_icache(mstate, va, pa, bits(instr, 20, 18), bit(instr, 17)); 20 | } 21 | } 22 | return nothing_special; 23 | } 24 | -------------------------------------------------------------------------------- /arch/arm/mach/sa1100.h: -------------------------------------------------------------------------------- 1 | #ifndef _SA1100_H_ 2 | #define _SA1100_H_ 3 | 4 | enum 5 | { 6 | RTC_ALARM_IRQ = (1 << 31), 7 | RTC_HZ_IRQ = (1 << 30), 8 | OS_IRQ_SHF = 26, 9 | UART3_IRQ = (1 << 17), 10 | }; 11 | 12 | enum 13 | { 14 | ICIP = 0x90050000, 15 | ICMR = 0x90050004, 16 | ICLR = 0x90050008, 17 | ICFP = 0x90050010, 18 | ICPR = 0x90050020, 19 | ICCR = 0x9005000C, 20 | 21 | RTAR = 0x90010000, 22 | RCNR = 0x90010004, 23 | RTTR = 0x90010008, 24 | RTSR = 0x90010010, 25 | 26 | OSMR0 = 0x90000000, 27 | OSMR1 = 0x90000004, 28 | OSMR2 = 0x90000008, 29 | OSMR3 = 0x9000000C, 30 | OSCR = 0x90000010, 31 | OSSR = 0x90000014, 32 | OWER = 0x90000018, 33 | OIER = 0x9000001C, 34 | 35 | /*UART3 */ 36 | UTCR0 = 0x80050000, 37 | UTCR1 = 0x80050004, 38 | UTCR2 = 0x80050008, 39 | UTCR3 = 0x8005000C, 40 | UTDR = 0x80050014, 41 | UTSR0 = 0x8005001C, 42 | UTSR1 = 0x80050020, 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /ipc/shell.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys, time 4 | import os, struct, code, traceback, readline 5 | from ipc import * 6 | import __main__ 7 | import __builtin__ 8 | 9 | ipc = SkyeyeIPC() 10 | 11 | saved_display = sys.displayhook 12 | 13 | def display(val): 14 | global saved_display 15 | if isinstance(val, int) or isinstance(val, long): 16 | __builtin__._ = val 17 | print hex(val) 18 | else: 19 | saved_display(val) 20 | 21 | sys.displayhook = display 22 | 23 | # convenience 24 | h = hex 25 | 26 | SCRATCH = 0x11000000 27 | 28 | locals = __main__.__dict__ 29 | 30 | for attr in dir(ipc): 31 | locals[attr] = getattr(ipc,attr) 32 | del attr 33 | 34 | class ConsoleMod(code.InteractiveConsole): 35 | def showtraceback(self): 36 | type, value, tb = sys.exc_info() 37 | self.write(traceback.format_exception_only(type, value)[0]) 38 | 39 | ConsoleMod(locals).interact("Have fun!") 40 | 41 | -------------------------------------------------------------------------------- /skyeye.conf: -------------------------------------------------------------------------------- 1 | arch: arm 2 | mach: starlet 3 | cpu: arm926ejs 4 | 5 | #log: logon=2, logfile=/dev/stdout, start=0x436e120, end=0x80000000 6 | #log: memlogon=1, logon=2, logfile=/tmp/sk1.log, start=0x0000000, end=0x8000000 7 | 8 | mem_bank: map=M, type=RW, addr=0x00000000, size=0x01800000 9 | mem_bank: map=A, type=RW, addr=0x02000000, size=0x01800000, dest=0x00000000 10 | 11 | mem_bank: map=M, type=RW, addr=0x10000000, size=0x04000000 12 | 13 | mem_bank: map=I, type=RW, addr=0x0D800000, size=0x00100000 14 | mem_bank: map=I, type=RW, addr=0x0D000000, size=0x00090000 15 | mem_bank: map=I, type=RW, addr=0x0D400000, size=0x00020000 16 | mem_bank: map=I, type=RW, addr=0x0DC00000, size=0x00020000 17 | mem_bank: map=I, type=RW, addr=0xFFF00000, size=0x00100000 18 | 19 | nandflash:type=starlet,name=HY27UF084G2M,dump=./nand.bin,dumptype=0,int=1 20 | #nandflash:type=starlet,name=HEADER,dump=./nand.bin,dumptype=0,int=1 21 | -------------------------------------------------------------------------------- /misc/gdb/README: -------------------------------------------------------------------------------- 1 | README for gdb with SkyEye 2 | (teawater@gmail.com) 3 | 4 | You can compile gdb-6.4 with skyeye-1.2 by the following command: 5 | tar vxjf gdb-6.4.tar.bz2 6 | tar xjvf skyeye-v1.2_Rel.tar.bz2 7 | cd SKYEYE_SOURCE_DIR 8 | cat SKYEYE_SOURCE_DIR/misc/gdb/skyeye_1.2_for_gdb_6.4.diff|patch -p1 9 | cd.. 10 | cp SKYEYE_SOURCE_DIR gdb-6.4/ 11 | cd gdb-6.4 12 | tar vxjf skyeye-v1.2_Rel_gdb.tar.bz2 13 | cd skyeye-v1 14 | make patchgdb6.4 15 | cd .. 16 | ./configure --target=arm-elf 17 | make 18 | make install 19 | Then run it by the following command: 20 | gdbskyeye image_name 21 | (gdb)target skyeye 22 | (gdb)load 23 | (gdb)run 24 | -------------------------------------------------------------------------------- /arch/bfin/common/un-syscall.h: -------------------------------------------------------------------------------- 1 | 2 | /* !!! DANGER !!! 3 | This was copied from newlib. */ 4 | 5 | 6 | #define SYS_exit 1 7 | #define SYS_fork 2 8 | #define SYS_read 3 9 | #define SYS_write 4 10 | #define SYS_open 5 11 | #define SYS_close 6 12 | #define SYS_wait4 7 13 | #define SYS_creat 8 14 | #define SYS_link 9 15 | #define SYS_unlink 10 16 | #define SYS_execv 11 17 | #define SYS_chdir 12 18 | #define SYS_mknod 14 19 | #define SYS_chmod 15 20 | #define SYS_chown 16 21 | #define SYS_lseek 19 22 | #define SYS_getpid 20 23 | #define SYS_isatty 21 24 | #define SYS_fstat 22 25 | #define SYS_time 23 26 | #define SYS_ARG 24 27 | #define SYS_stat 38 28 | #define SYS_pipe 42 29 | #define SYS_execve 59 30 | #define SYS_truncate 129 31 | #define SYS_ftruncate 130 32 | #define SYS_argc 172 33 | #define SYS_argnlen 173 34 | #define SYS_argn 174 35 | #define SYS_utime 201 /* not really a system call */ 36 | #define SYS_wait 202 /* nor is this */ 37 | -------------------------------------------------------------------------------- /arch/ppc/common/types.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPES_H__ 2 | #define __TYPES_H__ 3 | 4 | #include 5 | #include 6 | 7 | #ifndef __BEOS__ 8 | typedef enum{ 9 | false = 0, 10 | true = 1 11 | }bool; 12 | 13 | #define uint64 uint64_t 14 | #define uint32 uint32_t 15 | #define uint16 uint16_t 16 | #define uint8 uint8_t 17 | #else 18 | /* HEY, bool/uint8/uint16/uint32/uint64 typedef'd by system */ 19 | #include 20 | #endif 21 | 22 | #define sint64 int64_t 23 | #define sint32 int32_t 24 | #define sint16 int16_t 25 | #define sint8 int8_t 26 | 27 | #define byte int8_t 28 | #define uint uint32_t 29 | 30 | typedef struct uint128 { 31 | uint64 l; 32 | uint64 h; 33 | } uint128; 34 | typedef struct sint128 { 35 | sint64 l; 36 | sint64 h; 37 | } sint128; 38 | 39 | #define FASTCALL 40 | 41 | #define IO_MEM_ACCESS_OK 0 42 | #define IO_MEM_ACCESS_EXC 1 43 | #define IO_MEM_ACCESS_FATAL 2 44 | 45 | #define FUNCTION_CONST const 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /arch/bfin/common/syscall.h: -------------------------------------------------------------------------------- 1 | /* This file is copied from newlib. Do not edit this alone. */ 2 | 3 | #define SYS_exit 1 4 | #define SYS_fork 2 5 | 6 | #define SYS_read 3 7 | #define SYS_write 4 8 | #define SYS_open 5 9 | #define SYS_close 6 10 | #define SYS_wait4 7 11 | #define SYS_creat 8 12 | #define SYS_link 9 13 | #define SYS_unlink 10 14 | #define SYS_execv 11 15 | #define SYS_chdir 12 16 | #define SYS_mknod 14 17 | #define SYS_chmod 15 18 | #define SYS_chown 16 19 | #define SYS_lseek 19 20 | #define SYS_getpid 20 21 | #define SYS_isatty 21 22 | #define SYS_fstat 22 23 | #define SYS_time 23 24 | 25 | 26 | #define SYS_kill 24 27 | #define SYS_stat 38 28 | 29 | #define SYS_pipe 42 30 | #define SYS_execve 59 31 | 32 | #define SYS_truncate 129 33 | #define SYS_ftruncate 130 34 | 35 | #define SYS_argc 172 /* == 0xAC, for Argument Count :-) */ 36 | #define SYS_argnlen 173 37 | #define SYS_argn 174 38 | 39 | #define SYS_utime 201 /* not really a system call */ 40 | #define SYS_wait 202 /* nor is this */ 41 | -------------------------------------------------------------------------------- /dbct/oplet/movl_gen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "target_reg.h" 3 | #include "host_reg.h" 4 | 5 | int main(){ 6 | char * filename = "movl_oplet.c"; 7 | FILE * fd = fopen(filename, "w+"); 8 | int i = 0, j = 0; 9 | for(; i < sizeof(host_regs)/sizeof(reg_t);i++){ 10 | j = 0; 11 | for(; j < sizeof(host_regs)/sizeof(reg_t);j++){ 12 | fprintf(fd, "uint8_t * get_op_movl_%s_%s (int * len)\n", host_regs[i].ir_regname, host_regs[j].ir_regname); 13 | fprintf(fd, "{\n"); 14 | fprintf(fd, "\tuint8_t * ret;\n"); 15 | fprintf(fd, "\tOP_BEGIN (\"get_op_movl_%s_%s\");\n", host_regs[i].ir_regname, host_regs[j].ir_regname); 16 | fprintf(fd, "\t%s = %s;\n", host_regs[j].ir_regname, target_regs[i].regvalue); 17 | fprintf(fd, "\tOP_END (\"get_op_movl_%s_%s\");\n", target_regs[i].regname, host_regs[j].ir_regname); 18 | fprintf(fd, "\t*len = end - begin;\n"); 19 | fprintf(fd, "\tret = (uint8_t *)begin;\n"); 20 | fprintf(fd, "\treturn (ret);\n"); 21 | fprintf(fd, "}\n"); 22 | } 23 | } 24 | fclose(fd); 25 | } 26 | -------------------------------------------------------------------------------- /misc/conf/configs/mkdefconfig: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This script is used to make the default config file: defconfig. 3 | 4 | FEATURE_IN=feature.in 5 | DEFCONFIG=defconfig 6 | 7 | SAVEIFS=$IFS 8 | IFS== 9 | 10 | 11 | function check_def_yes () { 12 | if grep "$1" $CONFIGURE_HELP | grep "" > /dev/null; then 13 | return 0 14 | else 15 | return -1 16 | fi 17 | } 18 | 19 | echo "# default config file, made by mkdefconfig" > $DEFCONFIG 20 | echo "" >> $DEFCONFIG 21 | 22 | if [ -s $FEATURE_IN ]; then 23 | while read var_config feature 24 | do 25 | 26 | if [ "$feature" != "" ]; then 27 | if check_def_yes $feature; then 28 | echo $var_config=y >> $DEFCONFIG 29 | else 30 | echo $var_config=n >> $DEFCONFIG 31 | fi 32 | else 33 | echo $var_config >> $DEFCONFIG 34 | fi 35 | 36 | done < $FEATURE_IN 37 | fi 38 | 39 | echo \ 40 | "CONFIG_PLATFORM_LINUX=y 41 | CONFIG_COMPILER_X86=y 42 | CONFIG_LIBC_GLIBC=y" \ 43 | >> $DEFCONFIG 44 | 45 | 46 | IFS=$SAVEIFS 47 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/Makefile: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE ?= 2 | EXTRA_CFLAGS ?= 3 | 4 | CC ?= $(CROSS_COMPILE)gcc 5 | CFLAGS = -Wall -fomit-frame-pointer -g -O2 -I../common -I../tracer $(EXTRA_CFLAGS) 6 | 7 | LD_R = $(CROSS_COMPILE)ld -r 8 | RM = rm -f 9 | LDFLAGS = 10 | 11 | BUILD = i.o 12 | C_SRCS = i_add.c i_adda.c i_addi.c i_addq.c i_addx.c i_and.c \ 13 | i_andi.c i_asx.c i_bcc.c i_btst.c i_clr.c i_cmp.c \ 14 | i_cmpa.c i_cmpi.c i_dc.c i_eor.c i_eori.c i_ext.c \ 15 | i_halt.c i_illegal.c i_jmp.c i_jsr.c i_lea.c \ 16 | i_link.c i_lsx.c i_move.c i_movec.c i_movem.c \ 17 | i_moveq.c i_movexr.c i_mulu_l.c i_mulu_w.c \ 18 | i_neg.c i_negx.c i_nop.c i_not.c i_or.c \ 19 | i_ori.c i_pea.c i_rte.c i_rts.c i_scc.c i_stop.c \ 20 | i_sub.c i_suba.c i_subi.c i_subq.c i_subx.c \ 21 | i_swap.c i_trap.c i_trapf.c i_tst.c i_unlk.c i_div.c 22 | 23 | OBJS = $(C_SRCS:.c=.o) 24 | 25 | all: $(BUILD) 26 | 27 | .c.o: 28 | $(CC) $(CFLAGS) -c $< 29 | 30 | clean: 31 | $(RM) $(OBJS) $(BUILD) 32 | 33 | $(BUILD): $(OBJS) 34 | $(LD_R) $(OBJS) -o $@ 35 | -------------------------------------------------------------------------------- /arch/arm/dbct/arm2x86_mul.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | /* 17 | * author teawater 18 | */ 19 | 20 | #ifndef _ARM2X86_MUL_H_ 21 | #define _ARM2X86_MUL_H_ 22 | 23 | extern op_table_t op_mul_T0_T1; 24 | extern op_table_t op_umull_T0_T1; 25 | extern op_table_t op_smull_T0_T1; 26 | 27 | extern int arm2x86_mul_init (); 28 | 29 | #endif //_ARM2X86_MUL_H_ 30 | -------------------------------------------------------------------------------- /misc/auto_test/daily_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | TESTSUITE_PATH=/home/chy/develop/testsuite2 3 | DEVELOPER_NAME=chenyu 4 | export CVSROOT=":ext:${DEVELOPER_NAME}@gro.clinux.org:/cvsroot/skyeye" 5 | export CVS_RSH="ssh" 6 | cd ${TESTSUITE_PATH}/ 7 | 8 | #Zero step: clean old files 9 | rm -rf ./skyeye-v1 10 | rm -f ./skyeye ./auto_test ./exec_skyeye.sh ./exec_skyeye_dbct.sh 11 | 12 | #First step: check newest source from cvs 13 | cvs -z3 -d:ext:${DEVELOPER_NAME}@cvs.gro.clinux.org:/cvsroot/skyeye co skyeye-v1 14 | #build skyeye with DBCT function 15 | #cp -f ${TESTSUITE_PATH}/Makefile_gcc-3.3_with_DBCT_X86_32 skyeye-v1/ 16 | #second step: build skyeye image 17 | cd skyeye-v1 18 | #make CC=gcc-3.3 -C skyeye-v1 19 | make -f Makefile_gcc-3.3_with_DBCT_X86_32 20 | cd .. 21 | 22 | #third step: copy some files into testsuite path,and run 23 | cp skyeye-v1/binary/skyeye ${TESTSUITE_PATH}/ 24 | cp skyeye-v1/utils/tools/auto_test/auto_test ${TESTSUITE_PATH}/ 25 | cp skyeye-v1/utils/tools/auto_test/exec_skyeye.sh ${TESTSUITE_PATH}/ 26 | cp skyeye-v1/utils/tools/auto_test/exec_skyeye_dbct.sh ${TESTSUITE_PATH}/ 27 | 28 | ./auto_test 29 | -------------------------------------------------------------------------------- /arch/coldfire/common/addressing.h: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | 10 | struct _Address { 11 | short Size; 12 | char Mode; 13 | char Register; 14 | unsigned int Address; 15 | unsigned int Data; 16 | }; 17 | 18 | 19 | /*ng Addressing_Retr(short Size, char Mode, char Register, char EAValue); 20 | void Addressing_Stor(short Size, char Mode, char Register, long Value);*/ 21 | int Addressing_Print(short Size, char Mode, char Register, char *Str); 22 | 23 | char EA_GetFromPC(struct _Address *Addr, short Size, char Mode, char Register); 24 | char EA_GetValue(unsigned int *Result, struct _Address *Addr); 25 | char EA_GetEA(unsigned int *Result, struct _Address *Addr); 26 | /*long EA_GetAddress(struct _Address *Addr);*/ 27 | void EA_PutValue(struct _Address *Addr, unsigned int Value); 28 | 29 | void Stack_Push(short Size, unsigned int Value); 30 | unsigned int Stack_Pop(short Size); 31 | 32 | -------------------------------------------------------------------------------- /utils/scripts/check-bfd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Written by Anthony Lee 2007.03 4 | # 5 | 6 | printf "Checking bfd library ... " 7 | 8 | case $CC in 9 | *gcc*) 10 | ;; 11 | *) 12 | # other compiler, should be checked manually. 13 | printf "IGNORE\n" 14 | exit 0 15 | ;; 16 | esac 17 | 18 | SRC=" 19 | #include 20 | #include 21 | int main(int argc, char **argv) 22 | { 23 | bfd *abfd = bfd_openr(NULL, NULL); 24 | return 0; 25 | } 26 | " 27 | 28 | PROG="check-bfd" 29 | OBJECT="${BINARY_DIR}${PROG}.o" 30 | TARGET="${BINARY_DIR}${PROG}${SUFFIX}" 31 | ERR_MESSAGE="*** It seems that you don't have bfd library. 32 | *** Run \"make NO_BFD=1\" instead to ignore it." 33 | 34 | if ! ( echo "$SRC" | $CC $EXTRA_CFLAGS -o "$OBJECT" -c -x c - > /dev/null 2>&1 ); then 35 | printf "FAILED\n\n" 36 | printf "$ERR_MESSAGE\n\n" 37 | exit 1 38 | fi 39 | 40 | if ! ( $CC -o "$TARGET" "$OBJECT" $BFD_LIBS $EXTRA_LIBS > /dev/null 2>&1 ); then 41 | printf "FAILED\n\n" 42 | printf "$ERR_MESSAGE\n\n" 43 | rm -f "$OBJECT" 44 | exit 1 45 | fi 46 | 47 | rm -f "$OBJECT" 48 | rm -f "$TARGET" 49 | 50 | printf "OK\n" 51 | 52 | exit 0 53 | 54 | -------------------------------------------------------------------------------- /arch/arm/common/mmu/arm7100_mmu.h: -------------------------------------------------------------------------------- 1 | /* 2 | ARMulator extensions for the ARM7100 family. 3 | Copyright (C) 1999 Ben Williamson 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | #ifndef _ARM7100_MMU_H_ 20 | #define _ARM7100_MMU_H_ 21 | 22 | typedef struct arm7100_mmu_s 23 | { 24 | cache_t cache_t; 25 | tlb_t tlb_t; 26 | } arm7100_mmu_t; 27 | 28 | extern mmu_ops_t arm7100_mmu_ops; 29 | #endif /*_ARM7100_MMU_H_*/ 30 | -------------------------------------------------------------------------------- /utils/portable/beos/usleep.c: -------------------------------------------------------------------------------- 1 | /* 2 | usleep.c - portable usleep function for skyeye on BeOS 3 | Copyright (C) 2007 Anthony Lee 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | /* 21 | * 03/03/2007 written by Anthony Lee 22 | */ 23 | 24 | #include 25 | #include "utils/portable/usleep.h" 26 | 27 | int usleep(unsigned long usec) 28 | { 29 | snooze((bigtime_t)usec); 30 | return 0; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /arch/ppc/mach/skyeye_mach_mpc823.c: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_mach_mpc823.c - peripherl implementation of MPC823 3 | Copyright (C) 2006 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 12/16/2006 Michael.Kang 23 | */ 24 | 25 | 26 | #include "mpc823.h" 27 | -------------------------------------------------------------------------------- /arch/arm/common/armengr.h: -------------------------------------------------------------------------------- 1 | /* armengr.h -- ARMulator emulation macros: SA11x Instruction Emulator. 2 | Copyright (C) 1994 Advanced RISC Machines Ltd. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 17 | #ifndef _ARMENGR_H_ 18 | #define _ARMENGR_H_ 19 | 20 | extern void ARMul_EnergyInit (ARMul_State * state); 21 | extern void ARMul_do_energy (ARMul_State * state, ARMword instr, ARMword pc); 22 | extern void ARMul_do_cycle (ARMul_State * state); 23 | #endif 24 | -------------------------------------------------------------------------------- /arch/arm/common/mmu/arm920t_mmu.h: -------------------------------------------------------------------------------- 1 | /* 2 | arm920t_mmu.h - ARM920T Memory Management Unit emulation. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifndef _ARM920T_MMU_H_ 20 | #define _ARM920T_MMU_H_ 21 | 22 | typedef struct arm920t_mmu_s 23 | { 24 | tlb_t i_tlb; 25 | cache_t i_cache; 26 | 27 | tlb_t d_tlb; 28 | cache_t d_cache; 29 | wb_t wb_t; 30 | } arm920t_mmu_t; 31 | 32 | extern mmu_ops_t arm920t_mmu_ops; 33 | #endif /*_ARM920T_MMU_H_*/ 34 | -------------------------------------------------------------------------------- /arch/ppc/common/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PearPC 3 | * debug.h 4 | * 5 | * Copyright (C) 2003, 2004 Sebastian Biallas (sb@biallas.net) 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License version 2 as 9 | * published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #ifndef __DEBUG_H__ 22 | #define __DEBUG_H__ 23 | 24 | #include "types.h" 25 | 26 | /* 27 | * Debugger Interface 28 | */ 29 | void ppc_set_singlestep_v(bool v, const char *file, int line, const char *infoformat, ...); 30 | void ppc_set_singlestep_nonverbose(bool v); 31 | 32 | #define SINGLESTEP(info...) ppc_set_singlestep_v(true, __FILE__, __LINE__, info) 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /arch/arm/common/mmu/arm926ejs_mmu.h: -------------------------------------------------------------------------------- 1 | /* 2 | arm926ejs_mmu.h - ARM926EJS Memory Management Unit emulation. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifndef _ARM926EJS_MMU_H_ 20 | #define _ARM926EJS_MMU_H_ 21 | 22 | typedef struct arm926ejs_mmu_s 23 | { 24 | tlb_t main_tlb; 25 | tlb_t lockdown_tlb; 26 | 27 | cache_t i_cache; 28 | cache_t d_cache; 29 | wb_t wb_t; 30 | } arm926ejs_mmu_t; 31 | 32 | extern mmu_ops_t arm926ejs_mmu_ops; 33 | #endif /*_ARM926EJS_MMU_H_*/ 34 | -------------------------------------------------------------------------------- /arch/bfin/mach/bf533_irq.h: -------------------------------------------------------------------------------- 1 | /* 2 | bf533_irq.h - irq for blackfin simulation 3 | Copyright (C) 2003-2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 12/16/2006 Michael.Kang 23 | */ 24 | #ifndef __BF533_IRQ_H__ 25 | #define __BF533_IRQ_H__ 26 | #define CORE_TIMER_IRQ 6 27 | #define EXCEPT_IRQ 3 28 | #endif 29 | -------------------------------------------------------------------------------- /arch/mips/common/types.h: -------------------------------------------------------------------------------- 1 | #ifndef _SKYEYE_MIPS_TYPES_H_ 2 | #define _SKYEYE_MIPS_TYPES_H_ 3 | 4 | #include "inttypes.h" 5 | 6 | /* Fundamental types */ 7 | 8 | typedef UInt32 VA; //Virtual address 9 | typedef UInt32 PA; //Physical address 10 | typedef UInt32 Instr; //Instruction 11 | 12 | /* Width of the MIPS address space. 13 | * static const int paddr_width = 36; 14 | */ 15 | #define paddr_width 32 16 | 17 | /* Caching algorithm numbers */ 18 | #define noncoherent_write_through 0 19 | #define noncoherent_write_allocate 1 20 | #define uncached 2 21 | #define noncoherent_write_back 3 22 | #define exclusive 4 23 | #define exclusive_on_write 5 24 | #define update_on_write 6 25 | 26 | /* Hardware data types */ 27 | #define byte 0 28 | #define halfword 1 29 | #define triplebyte 2 30 | #define word 3 31 | #define quintibyte 4 32 | #define sextibyte 5 33 | #define septibyte 6 34 | #define doubleword 7 35 | 36 | /* The caching algorithm is stored as part of the physical address, 37 | * using the same encoding as that of XKPHYS address space region. 38 | */ 39 | static int 40 | coherency_algorithm(PA pa) //Shi yang 2006-08-08 41 | { 42 | return bits(pa, 31, 29); 43 | } 44 | 45 | #endif //end of _SKYEYE_MIPS_TYPES_H_ 46 | -------------------------------------------------------------------------------- /utils/portable/gettimeofday.c: -------------------------------------------------------------------------------- 1 | /* 2 | gettimeofday.c - portable gettimeofday function for skyeye 3 | Copyright (C) 2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 03/03/2007 initial version by Anthony Lee 23 | */ 24 | 25 | #include "gettimeofday.h" 26 | 27 | #ifndef HAVE_GETTIMEOFDAY 28 | 29 | #ifdef __MINGW32__ 30 | #include "./win32/gettimeofday.c" 31 | #endif /* __MINGW32__ */ 32 | 33 | #endif /* !HAVE_GETTIMEOFDAY */ 34 | 35 | -------------------------------------------------------------------------------- /arch/arm/common/mmu/rb.h: -------------------------------------------------------------------------------- 1 | #ifndef _MMU_RB_H 2 | #define _MMU_RB_H 3 | 4 | enum rb_type_t 5 | { 6 | RB_INVALID = 0, //invalid 7 | RB_1, //1 word 8 | RB_4, //4 word 9 | RB_8, //8 word 10 | }; 11 | 12 | /*bytes of each rb_type*/ 13 | extern ARMword rb_masks[]; 14 | 15 | #define RB_WORD_NUM 8 16 | typedef struct rb_entry_s 17 | { 18 | ARMword data[RB_WORD_NUM]; //array to store data 19 | ARMword va; //first word va 20 | int type; //rb type 21 | fault_t fault; //fault set by rb alloc 22 | } rb_entry_t; 23 | 24 | typedef struct rb_s 25 | { 26 | int num; 27 | rb_entry_t *entrys; 28 | } rb_t; 29 | 30 | /*mmu_rb_init 31 | * @rb_t :rb_t to init 32 | * @num :number of entry 33 | * */ 34 | int mmu_rb_init (rb_t * rb_t, int num); 35 | 36 | /*mmu_rb_exit*/ 37 | void mmu_rb_exit (rb_t * rb_t); 38 | 39 | 40 | /*mmu_rb_search 41 | * @rb_t :rb_t to serach 42 | * @va :va address to math 43 | * 44 | * $ NULL :not match 45 | * NO-NULL: 46 | * */ 47 | rb_entry_t *mmu_rb_search (rb_t * rb_t, ARMword va); 48 | 49 | 50 | void mmu_rb_invalidate_entry (rb_t * rb_t, int i); 51 | void mmu_rb_invalidate_all (rb_t * rb_t); 52 | void mmu_rb_load (ARMul_State * state, rb_t * rb_t, int i_rb, 53 | int type, ARMword va); 54 | 55 | #endif /*_MMU_RB_H_*/ 56 | -------------------------------------------------------------------------------- /arch/ppc/common/ppc_tools.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PearPC 3 | * ppc_tools.h 4 | * 5 | * Copyright (C) 2003 Sebastian Biallas (sb@biallas.net) 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License version 2 as 9 | * published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #ifndef __PPC_TOOLS_H__ 22 | #define __PPC_TOOLS_H__ 23 | 24 | #include "types.h" 25 | 26 | static inline bool ppc_carry_3(uint32 a, uint32 b, uint32 c) 27 | { 28 | if ((a+b) < a) { 29 | return true; 30 | } 31 | if ((a+b+c) < c) { 32 | return true; 33 | } 34 | return false; 35 | } 36 | 37 | static inline uint32 ppc_word_rotl(uint32 data, int n) 38 | { 39 | n &= 0x1f; 40 | return (data << n) | (data >> (32-n)); 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /ipc/launchios.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from ipc import * 5 | 6 | ios = int(sys.argv[1]) 7 | titleID = 0x100000000 | ios 8 | 9 | print "Waiting for IPC to start up..." 10 | ipc = SkyeyeIPC() 11 | ipc.init() 12 | print "IPC ready" 13 | print "Going to launch IOS%d"%ios 14 | 15 | fd = ipc.IOSOpen("/dev/es") 16 | print "ES fd: %d"%fd 17 | if fd < 0: 18 | print "Error opening ES" 19 | sys.exit(1) 20 | 21 | tikbuf = ipc.makebuf(216) 22 | res = ipc.IOSIoctlv(fd, 0x13, "qi:d", titleID, 1, tikbuf) 23 | if res < 0: 24 | print "Error %d getting ticket views"%res 25 | ipc.IOSClose(fd) 26 | sys.exit(1) 27 | 28 | print "Launching..." 29 | 30 | # this special sequence is specific for IOS reboots 31 | # issue an async request, then wait for EITHER a reply OR a ack 32 | # ack means IOS rebooted, reply means some kind of fail 33 | # send an ack after a successful reboot to reinit IPC 34 | launchres = IOSIoctlv(fd, 0x08, "qd:", titleID, tikbuf) 35 | ipc.clearack() 36 | ipc.async(launchres) 37 | while ipc.acks == 0 and not launchres.done: 38 | ipc.processmsg() 39 | 40 | tikbuf.free() 41 | if ipc.acks != 0: 42 | ipc.sendack() 43 | launchres.free() 44 | print "IOS%d launched"%ios 45 | else: 46 | print "Error %d while launching"%launchres.result 47 | ipc.IOSClose(fd) 48 | -------------------------------------------------------------------------------- /arch/coldfire/mach/mcf5249.h: -------------------------------------------------------------------------------- 1 | /* 2 | mcf5249.c - necessary mcf5249 definition for skyeye debugger 3 | Copyright (C) 2003-2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 02/28/2007 Michael.Kang 23 | */ 24 | 25 | #ifndef __MCF5249_H__ 26 | #define __MCF5249_H__ 27 | 28 | #define CSAR 0 29 | #define CSMR 1 30 | #define CSCR 2 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /utils/portable/usleep.c: -------------------------------------------------------------------------------- 1 | /* 2 | usleep.c - portable usleep function for skyeye 3 | Copyright (C) 2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 03/03/2007 initial version by Anthony Lee 23 | */ 24 | 25 | #include "usleep.h" 26 | 27 | #ifndef HAVE_USLEEP 28 | 29 | #ifdef __MINGW32__ 30 | #include "./win32/usleep.c" 31 | #endif /* __MINGW32__ */ 32 | 33 | #ifdef __BEOS__ 34 | #include "./beos/usleep.c" 35 | #endif /* __BEOS__ */ 36 | 37 | #endif /* !HAVE_USLEEP */ 38 | 39 | -------------------------------------------------------------------------------- /utils/scripts/check-x86-asm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Written by Anthony Lee 2007.03 4 | # 5 | 6 | printf "Checking whether the compiler supports x86 asm ... " 7 | 8 | case $CC in 9 | *gcc*) 10 | ;; 11 | *) 12 | # other compiler, should be checked manually. 13 | printf "IGNORE\n" 14 | exit 0 15 | ;; 16 | esac 17 | 18 | SRC=" 19 | int main(int argc, char **argv) 20 | { 21 | int i = 1; 22 | __asm__ (\" \ 23 | pushl %%eax\n \ 24 | movl %0, %%eax\n \ 25 | subl \$1, %%eax\n \ 26 | movl %%eax, %0\n \ 27 | popl %%eax\" \ 28 | : \ 29 | : \"g\" (i) 30 | ); 31 | return i; 32 | }" 33 | 34 | PROG="check-x86-asm" 35 | OBJECT="${BINARY_DIR}${PROG}.o" 36 | TARGET="${BINARY_DIR}${PROG}${SUFFIX}" 37 | ERR_MESSAGE="*** It seems that the compiler don't support inline x86 AT&T ASM codes. 38 | *** Run \"make NO_DBCT=1\" instead to ignore it." 39 | 40 | if ! ( echo "$SRC" | $CC $EXTRA_CFLAGS -o "$OBJECT" -c -x c - > /dev/null 2>&1 ); then 41 | printf "FAILED\n\n" 42 | printf "$ERR_MESSAGE\n\n" 43 | exit 1 44 | fi 45 | 46 | if ! ( $CC -o "$TARGET" "$OBJECT" $EXTRA_LIBS > /dev/null 2>&1 ); then 47 | printf "FAILED\n\n" 48 | printf "$ERR_MESSAGE\n\n" 49 | rm -f "$OBJECT" 50 | exit 1 51 | fi 52 | 53 | rm -f "$OBJECT" 54 | rm -f "$TARGET" 55 | 56 | printf "OK\n" 57 | 58 | exit 0 59 | 60 | -------------------------------------------------------------------------------- /utils/portable/usleep.h: -------------------------------------------------------------------------------- 1 | /* 2 | usleep.h - portable usleep function for skyeye 3 | Copyright (C) 2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 03/03/2007 initial version by Anthony Lee 23 | */ 24 | 25 | #ifndef __SKYEYE_USLEEP_H__ 26 | #define __SKYEYE_USLEEP_H__ 27 | 28 | #if !(defined(__MINGW32__) || defined(__BEOS__)) 29 | 30 | #include 31 | #define HAVE_USLEEP 32 | 33 | #else 34 | 35 | int usleep(unsigned long usec); 36 | 37 | #endif 38 | 39 | #endif /* __SKYEYE_USLEEP_H__ */ 40 | 41 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | List of maintainers and how to submit your patch 2 | 3 | SUBMIT PATCH: 4 | For the developer of SkyEye(who has commit privilege of SkyEye cvs repository): 5 | If you just fix a bug or add some improvement based on the existed code of SkyEye. You can send your patch to skyeye developer maillist(Now it is skyeye-developer@lists.gro.clinux.org).If no one give different opinions for your patch, you can commit it by yourself. 6 | For the new bie of SkyEye(who have no privilege of SkyEye cvs repository): 7 | You can send your patch to the following MAINTAINERS list after you test your patch on the newest SkyEye version. 8 | 9 | Global MAINTAINERS: 10 | Chen Yu ( chyyuu@gmail.com ) 11 | Michael Kang ( blackfin.kang@gmail.com ) 12 | 13 | Key Developers: Wang Liming ( walimisdev@gmail.com ) 14 | Yang Ye 15 | Tea Water 16 | Kang Shuo 17 | 18 | Main Developer: Ying Wen Chao 19 | Yang Jian 20 | Liu Yuhong 21 | Trilok Soni 22 | Koodailar 23 | Zeng Yi 24 | Lu Zhe Tao 25 | Li Ming 26 | Ying Sou Yi 27 | Wang Yong Hao 28 | Zhang Zhi Chao 29 | Yang Ji Long 30 | Shi Yang 31 | Cai Qiang 32 | Luo Hui 33 | Song zhenyu 34 | 35 | 36 | Contributors: Wen Ye 37 | Benno 38 | Simone Zinanni 39 | Stefano Fedrigo 40 | Lian Zhu Lin 41 | Anthony Lee 42 | -------------------------------------------------------------------------------- /utils/config/skyeye_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_arch.h - some generic arch definition for skyeye debugger 3 | Copyright (C) 2003 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 12/16/2006 Michael.Kang 23 | */ 24 | #ifndef __SKYEYE_ARCH_H__ 25 | #define __SKYEYE_ARCH_H__ 26 | /* the number of supported architecture */ 27 | #define MAX_SUPP_ARCH 8 28 | 29 | void initialize_all_arch (); 30 | #endif 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | SkyEye in Linux or other NON-Windows Operating Systems uses GNU GENERAL PUBLIC LICENSE Version 2. 2 | 3 | The simulation code of ppc is originally developed by PearPC Project.Please see the license from header part of its source file .Its official website is http://pearpc.sourceforge.net/ 4 | 5 | The simulation code of coldfire under arch/coldfire is originally developed by David Grant. Please read its license from header of its source file. Its development site is http://www.slicer.ca/coldfire/index.php. 6 | 7 | All other part of SkyEye is developed by SkyEye Development Team. 8 | 9 | 10 | Copyright (C) 2003-2007 SkyEye Development Team. All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are met: 14 | 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 3. The name of the author may not be used to endorse or promote products 21 | derived from this software without specific prior written permission. 22 | 23 | -------------------------------------------------------------------------------- /misc/conf/scripts/lxdialog/makefile.lx: -------------------------------------------------------------------------------- 1 | HOSTCFLAGS += -DLOCALE 2 | LIBS = -lncurses 3 | 4 | ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) 5 | HOSTCFLAGS += -I/usr/include/ncurses -DCURSES_LOC="" 6 | else 7 | ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) 8 | HOSTCFLAGS += -I/usr/include/ncurses -DCURSES_LOC="" 9 | else 10 | ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) 11 | HOSTCFLAGS += -DCURSES_LOC="" 12 | else 13 | HOSTCFLAGS += -DCURSES_LOC="" 14 | endif 15 | endif 16 | endif 17 | 18 | 19 | OBJS = checklist.o menubox.o textbox.o yesno.o inputbox.o \ 20 | util.o lxdialog.o msgbox.o 21 | 22 | %.o: %.c 23 | $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $< 24 | 25 | all: ncurses lxdialog 26 | 27 | lxdialog: $(OBJS) 28 | $(HOSTCC) -o lxdialog $(OBJS) $(LIBS) 29 | 30 | ncurses: 31 | @echo "main() {}" > lxtemp.c 32 | @if $(HOSTCC) -lncurses lxtemp.c ; then \ 33 | rm -f lxtemp.c a.out; \ 34 | else \ 35 | rm -f lxtemp.c; \ 36 | echo -e "\007" ;\ 37 | echo ">> Unable to find the Ncurses libraries." ;\ 38 | echo ">>" ;\ 39 | echo ">> You must have Ncurses installed in order" ;\ 40 | echo ">> to use 'make menuconfig'" ;\ 41 | echo ;\ 42 | exit 1 ;\ 43 | fi 44 | 45 | clean: 46 | rm -f core *.o *~ lxdialog 47 | -------------------------------------------------------------------------------- /ipc/importboot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from ipc import * 5 | sys.path.append(os.path.realpath(os.path.dirname(sys.argv[0]))+"/../../pywii/Common") 6 | import pywii as wii 7 | import sha 8 | 9 | wii.loadkeys() 10 | 11 | def getcerts(signed,certs): 12 | data = "" 13 | for certname in signed.issuer[::-1]: 14 | if certname == "Root": 15 | continue 16 | cert = certs[certname] 17 | data += cert.data 18 | return data 19 | 20 | wad = wii.WiiWad(sys.argv[1]) 21 | 22 | print "Going to import boot2 version",wad.tmd.title_version 23 | 24 | tmd = wad.tmd.data 25 | tik = wad.tik.data 26 | wad.showinfo() 27 | tikcerts = getcerts(wad.tik, wad.certs) 28 | tmdcerts = getcerts(wad.tmd, wad.certs) 29 | content = wad.getcontent(0, encrypted=True) 30 | content += "\x00" * 0 31 | content2 = wad.getcontent(0) 32 | 33 | wii.chexdump(wad.tmd.get_content_records()[0].sha) 34 | wii.chexdump(sha.new(content2).digest()) 35 | 36 | print "Waiting for IPC to start up..." 37 | ipc = SkyeyeIPC() 38 | ipc.init() 39 | print "IPC ready" 40 | 41 | fd = ipc.IOSOpen("/dev/es") 42 | print "ES fd: %d"%fd 43 | if fd < 0: 44 | print "Error opening ES" 45 | sys.exit(1) 46 | 47 | res = ipc.IOSIoctlv(fd, 0x1f, "dddddd", tik, tikcerts, tmd, tmdcerts, None, content) 48 | ipc.IOSClose(fd) 49 | 50 | if res < 0: 51 | print "Error %d importing boot2"%res 52 | else: 53 | print "boot2 import succeeded" 54 | 55 | -------------------------------------------------------------------------------- /utils/portable/beos/tap_driver/Makefile: -------------------------------------------------------------------------------- 1 | ifneq ($(OSTYPE),beos) 2 | ### for cross-compile 3 | CC = /usr/local/bin/i586-beos-gcc 4 | KERNEL = /usr/local/i586-beos/lib/_KERNEL_ 5 | else 6 | KERNEL = /boot/develop/lib/x86/_KERNEL_ 7 | endif 8 | 9 | EXTRA_CFLAGS ?= 10 | CFLAGS = -O3 -no-fpic $(EXTRA_CFLAGS) 11 | 12 | OBJECTS = skyeye_tap.o 13 | 14 | skyeye_tap : $(OBJECTS) 15 | $(CC) -nostdlib $^ -o $@ $(KERNEL) 16 | 17 | all: skyeye_tap 18 | 19 | clean: 20 | -rm -f Makefile.dep 21 | -rm -f *.o 22 | -rm -f skyeye_tap 23 | 24 | ifeq ($(OSTYPE),beos) 25 | 26 | install: skyeye_tap 27 | -mkdir -p /boot/home/config/add-ons/kernel/drivers/bin 28 | -cp -f ./skyeye_tap /boot/home/config/add-ons/kernel/drivers/bin/skyeye_tap 29 | -mkdir -p /boot/home/config/add-ons/kernel/drivers/dev/net 30 | -ln -sf ../../bin/skyeye_tap /boot/home/config/add-ons/kernel/drivers/dev/net/skyeye_tap 31 | 32 | uninstall: 33 | -rm -f /boot/home/config/add-ons/kernel/drivers/dev/net/skyeye_tap 34 | -rm -f /boot/home/config/add-ons/kernel/drivers/bin/skyeye_tap 35 | 36 | else 37 | 38 | install: 39 | @echo "*** You don't need this when cross-compile." 40 | 41 | uninstall: 42 | @echo "*** You don't need this when cross-compile." 43 | 44 | endif 45 | 46 | .SUFFIXES: .c .o 47 | .c.o: 48 | $(CC) $(CFLAGS) -c $< -o $@ 49 | 50 | Makefile.dep: 51 | -$(CC) $(CFLAGS) -MM skyeye_tap.c > Makefile.dep 52 | 53 | -include Makefile.dep 54 | -------------------------------------------------------------------------------- /utils/scripts/check-bigendian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Written by Anthony Lee 2007.03 4 | # 5 | 6 | case $CC in 7 | *gcc*) 8 | ;; 9 | *) 10 | # other compiler, should be checked manually. 11 | printf "IGNORE\n" 12 | exit 0 13 | ;; 14 | esac 15 | 16 | SRC=" 17 | static unsigned int data[] = {0x42696745, 0x6e646961, 0x6e537973}; 18 | 19 | int main(int argc, char **argv) 20 | { 21 | unsigned int v = 0x12345678; 22 | unsigned char *s = (unsigned char*)&v; 23 | 24 | exit((s[0] == 0x12 && s[1] == 0x34 && s[2] == 0x56 && s[3] == 0x78) ? 0 : 1); 25 | }" 26 | 27 | PROG="check-bigendian" 28 | OBJECT="${BINARY_DIR}${PROG}.o" 29 | TARGET="${BINARY_DIR}${PROG}${SUFFIX}" 30 | 31 | if ! ( echo "$SRC" | $CC -o "$OBJECT" -c -x c - > /dev/null 2>&1 ); then 32 | printf "FAILED (compiling object)" 33 | exit 1 34 | fi 35 | 36 | if test "x$CROSS_COMPILE" = "x"; then 37 | if ! ( $CC -o "$TARGET" "$OBJECT" > /dev/null 2>&1 ); then 38 | rm -f "$OBJECT" 39 | printf "FAILED (compiling program)" 40 | exit 1 41 | fi 42 | 43 | if ! ( "$TARGET" > /dev/null 2>&1 ); then 44 | rm -f "$OBJECT" 45 | rm -f "$TARGET" 46 | printf "no\n" 47 | exit 1 48 | fi 49 | elif ! ( grep "BigEndianSys" "$OBJECT" > /dev/null 2>&1 ); then 50 | rm -f "$OBJECT" 51 | rm -f "$TARGET" 52 | printf "no\n" 53 | exit 1 54 | fi 55 | 56 | rm -f "$OBJECT" 57 | rm -f "$TARGET" 58 | 59 | printf "yes\n" 60 | 61 | exit 0 62 | 63 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_illegal.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Generate Illegal Instruction (ILLEGAL) */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | 23 | INSTRUCTION_1ARG(ILLEGAL, 24 | unsigned Code,16); 25 | 26 | static void execute(void) 27 | { 28 | unsigned int dummy; 29 | /* Read the instruction with out storing it.. we already know what it is */ 30 | Memory_RetrWordFromPC(&dummy); 31 | exception_do_exception(4); 32 | 33 | return; 34 | } 35 | 36 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 37 | { 38 | unsigned int dummy; 39 | Memory_RetrWordFromPC(&dummy); 40 | sprintf(Instruction, "ILLEGAL"); 41 | Arg1[0]=0; 42 | Arg2[0]=0; 43 | return 0; 44 | } 45 | 46 | 47 | int illegal_5206_register(void) 48 | { 49 | instruction_register(0x4AFC, 0xFFFF, &execute, &disassemble); 50 | return 1; 51 | } 52 | -------------------------------------------------------------------------------- /arch/arm/common/mmu/wb.h: -------------------------------------------------------------------------------- 1 | #ifndef _MMU_WB_H_ 2 | #define _MMU_WB_H_ 3 | 4 | typedef struct wb_entry_s 5 | { 6 | ARMword pa; //phy_addr 7 | ARMbyte *data; //data 8 | int nb; //number byte to write 9 | } wb_entry_t; 10 | 11 | typedef struct wb_s 12 | { 13 | int num; //number of wb_entry 14 | int nb; //number of byte of each entry 15 | int first; // 16 | int last; // 17 | int used; // 18 | wb_entry_t *entrys; 19 | } wb_t; 20 | 21 | typedef struct wb_desc_s 22 | { 23 | int num; 24 | int nb; 25 | } wb_desc_t; 26 | 27 | /* wb_init 28 | * @wb_t :wb_t to init 29 | * @num :num of entrys 30 | * @nw :num of word of each entry 31 | * 32 | * $ -1:error 33 | * 0:ok 34 | * */ 35 | int mmu_wb_init (wb_t * wb_t, int num, int nb); 36 | 37 | 38 | /* wb_exit 39 | * @wb_t :wb_t to exit 40 | * */ 41 | void mmu_wb_exit (wb_t * wb); 42 | 43 | 44 | /* wb_write_bytes :put bytess in Write Buffer 45 | * @state: ARMul_State 46 | * @wb_t: write buffer 47 | * @pa: physical address 48 | * @data: data ptr 49 | * @n number of byte to write 50 | * 51 | * Note: write buffer merge is not implemented, can be done late 52 | * */ 53 | void 54 | mmu_wb_write_bytes (ARMul_State * state, wb_t * wb_t, ARMword pa, 55 | ARMbyte * data, int n); 56 | 57 | 58 | /* wb_drain_all 59 | * @wb_t wb_t to drain 60 | * */ 61 | void mmu_wb_drain_all (ARMul_State * state, wb_t * wb_t); 62 | 63 | #endif /*_MMU_WB_H_*/ 64 | -------------------------------------------------------------------------------- /arch/arm/common/armio.h: -------------------------------------------------------------------------------- 1 | /* 2 | armio.c - I/O registers and interrupt controller. 3 | ARMulator extensions for the ARM7100 family. 4 | Copyright (C) 1999 Ben Williamson 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | #ifndef _ARMIO_H_ 22 | #define _ARMIO_H_ 23 | 24 | void io_reset (ARMul_State * state); 25 | void io_do_cycle (ARMul_State * state); 26 | ARMword io_read_word (ARMul_State * state, ARMword addr); 27 | void io_write_word (ARMul_State * state, ARMword addr, ARMword data); 28 | unsigned char mem_read_char (ARMul_State * state, ARMword addr); 29 | void mem_write_char (ARMul_State * state, ARMword addr, unsigned char c); 30 | 31 | 32 | #endif /* _ARMIO_H_ */ 33 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_nop.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* No Operation (NOP) */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int NOPTime=3; 23 | 24 | 25 | INSTRUCTION_1ARG(NOP, 26 | unsigned Code1,16); 27 | 28 | static void execute(void) 29 | { 30 | unsigned int dummy; 31 | /* Read the instruction with out storing it.. we already know what it is */ 32 | Memory_RetrWordFromPC(&dummy); 33 | 34 | 35 | cycle(NOPTime); /* Everything takes some time...*/ 36 | 37 | return; 38 | } 39 | 40 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 41 | { 42 | unsigned int dummy; 43 | Memory_RetrWordFromPC(&dummy); 44 | sprintf(Instruction, "NOP"); 45 | Arg1[0]=0; 46 | Arg2[0]=0; 47 | return 0; 48 | } 49 | 50 | 51 | int nop_5206_register(void) 52 | { 53 | instruction_register(0x4E71, 0xFFFF, &execute, &disassemble); 54 | return 1; 55 | } 56 | -------------------------------------------------------------------------------- /arch/bfin/common/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | types.h - necessary type definition for blackfin simulation 3 | Copyright (C) 2003-2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 12/16/2006 Michael.Kang 23 | */ 24 | 25 | 26 | #ifndef _TYPES_H 27 | #define _TYPES_H 28 | typedef unsigned char bu8; 29 | typedef unsigned short bu16; 30 | typedef unsigned int bu32; 31 | typedef unsigned long long bu64; 32 | typedef signed char bs8; 33 | typedef short bs16; 34 | typedef int bs32; 35 | typedef long long bs64; 36 | #endif 37 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_dc.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* DC.W */ 12 | /* Format ... well.. anything that any of the other instructions 13 | don't handle 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | 23 | INSTRUCTION_1ARG(DC, 24 | unsigned Code1,16); 25 | 26 | static void execute(void) 27 | { 28 | unsigned int dummy; 29 | /* Read the instruction, we already know what it is */ 30 | Memory_RetrWordFromPC(&dummy); 31 | /* Do an exception */ 32 | exception_do_exception(4); 33 | return; 34 | } 35 | 36 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 37 | { 38 | unsigned int dummy; 39 | Memory_RetrWordFromPC(&dummy); 40 | sprintf(Instruction, "DC.W"); 41 | sprintf(Arg1, "0x%04lx", dummy); 42 | Arg2[0]=0; 43 | return 0; 44 | } 45 | 46 | 47 | int dc_5206_register(void) 48 | { 49 | instruction_register(0x0000, 0x0000, &execute, &disassemble); 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /device/touchscreen/skyeye_touchscreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_touchscreen.h - skyeye general touchscreen device support functions 3 | Copyright (C) 2003 - 2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 03/19/2007 initial version by Anthony Lee 23 | */ 24 | 25 | #ifndef __SKYEYE_TOUCHSCREEN_H_ 26 | #define __SKYEYE_TOUCHSCREEN_H_ 27 | 28 | #include "skyeye_device.h" 29 | 30 | struct touchscreen_device 31 | { 32 | }; 33 | 34 | /* touchscreen controller initialize functions*/ 35 | extern void touchscreen_skyeye_init(struct device_module_set *mod_set); 36 | 37 | /* help function*/ 38 | 39 | #endif /* __SKYEYE_TOUCHSCREEN_H_ */ 40 | 41 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_rte.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Return from Exception (RTE) */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int RTETime=8; 23 | 24 | 25 | INSTRUCTION_1ARG(RTE, 26 | unsigned Code1,16); 27 | 28 | static void execute(void) 29 | { 30 | unsigned int dummy; 31 | /* Read the instruction with out storing it.. we already know what it is */ 32 | Memory_RetrWordFromPC(&dummy); 33 | 34 | exception_restore_from_stack_frame(); 35 | 36 | 37 | cycle(RTETime); 38 | 39 | return; 40 | } 41 | 42 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 43 | { 44 | unsigned int dummy; 45 | Memory_RetrWordFromPC(&dummy); 46 | sprintf(Instruction, "RTE"); 47 | Arg1[0]=0; 48 | Arg2[0]=0; 49 | return 0; 50 | } 51 | 52 | 53 | int rte_5206_register(void) 54 | { 55 | instruction_register(0x4E73, 0xFFFF, &execute, &disassemble); 56 | return 1; 57 | } 58 | -------------------------------------------------------------------------------- /arch/ppc/common/snprintf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HT Editor 3 | * snprintf.h 4 | * 5 | * Copyright (C) 1999-2003 Sebastian Biallas (sb@biallas.net) 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License version 2 as 9 | * published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #ifndef __SNPRINTF_H__ 22 | #define __SNPRINTF_H__ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | int ht_asprintf(char **ptr, const char *format, ...); 29 | int ht_vasprintf(char **ptr, const char *format, va_list ap); 30 | 31 | int ht_snprintf(char *str, size_t count, const char *fmt, ...); 32 | int ht_vsnprintf(char *str, size_t count, const char *fmt, va_list args); 33 | 34 | int ht_fprintf(FILE *file, const char *fmt, ...); 35 | int ht_vfprintf(FILE *file, const char *fmt, va_list args); 36 | 37 | int ht_printf(const char *fmt, ...); 38 | int ht_vprintf(const char *fmt, va_list args); 39 | #endif 40 | -------------------------------------------------------------------------------- /arch/ppc/common/ppc_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | /* 17 | * 12/06/2007 Michael.Kang 18 | */ 19 | 20 | #ifndef __PPC_MEMORY_H__ 21 | #define __PPC_MEMORY_H__ 22 | 23 | //byte boot_rom[8 * 1024 * 1024];/* default 8M boot rom for e500 core */ 24 | #define INIT_RAM_SIZE 0x4000 25 | extern byte * init_ram; /* 16k init ram for 8560 */ 26 | extern byte * boot_rom; /* default 8M bootrom for 8560 */ 27 | extern byte * ddr_ram; /* 64M DDR SDRAM */ 28 | extern unsigned long init_ram_start_addr, init_ram_size; 29 | extern uint32 boot_romSize; 30 | extern uint32 boot_rom_start_addr; 31 | #define DEFAULT_BOOTROM_SIZE (8 * 1024 * 1024) 32 | #define DDR_RAM_START_ADDR (0x0) 33 | #define DDR_RAM_SIZE (64 * 1024 * 1024) 34 | 35 | #define MPC8650_DPRAM_SIZE 0xC000 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_rts.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Return from Subroutine (RTS) */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int RTSTime=5; 23 | 24 | 25 | INSTRUCTION_1ARG(RTS, 26 | unsigned Code1,16); 27 | 28 | static void execute(void) 29 | { 30 | unsigned int dummy; 31 | /* Read the instruction with out storing it.. we already know what it is */ 32 | Memory_RetrWordFromPC(&dummy); 33 | 34 | /* Pop the PC from the A7 stack pointer */ 35 | memory_core.pc=Stack_Pop(32); 36 | 37 | 38 | cycle(RTSTime); 39 | 40 | return; 41 | } 42 | 43 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 44 | { 45 | unsigned int dummy; 46 | Memory_RetrWordFromPC(&dummy); 47 | sprintf(Instruction, "RTS"); 48 | Arg1[0]=0; 49 | Arg2[0]=0; 50 | return 0; 51 | } 52 | 53 | 54 | int rts_5206_register(void) 55 | { 56 | instruction_register(0x4E75, 0xFFFF, &execute, &disassemble); 57 | return 1; 58 | } 59 | -------------------------------------------------------------------------------- /utils/portable/win32/usleep.c: -------------------------------------------------------------------------------- 1 | /* 2 | usleep.c - portable usleep function for skyeye on Win32 3 | Copyright (C) 2007 Anthony Lee 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | /* 21 | * 03/03/2007 written by Anthony Lee 22 | */ 23 | 24 | #include 25 | #include "utils/portable/usleep.h" 26 | 27 | int usleep(unsigned long usec) 28 | { 29 | HANDLE timer = NULL; 30 | LARGE_INTEGER due; 31 | 32 | timer = CreateWaitableTimer(NULL, TRUE, NULL); 33 | if(timer == NULL) return -1; 34 | 35 | due.QuadPart = (-((__int64)usec)) * 10LL; 36 | if(!SetWaitableTimer(timer, &due, 0, NULL, NULL, 0)) 37 | { 38 | CloseHandle(timer); 39 | return -1; 40 | } 41 | WaitForSingleObject(timer, INFINITE); 42 | CloseHandle(timer); 43 | 44 | return 0; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /device/uart/skyeye_uart_net.c: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_uart_net.c - skyeye uart device from tcp port 3 | Copyright (C) 2003 - 2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 2007.01.18 by Anthony Lee : initial version 23 | */ 24 | 25 | #include "skyeye_uart.h" 26 | 27 | int uart_net_open(struct uart_device *uart_dev) 28 | { 29 | return -1; 30 | } 31 | 32 | 33 | int uart_net_close(struct uart_device *uart_dev) 34 | { 35 | return -1; 36 | } 37 | 38 | 39 | int uart_net_read(struct uart_device *uart_dev, void *buf, size_t count, struct timeval *timeout) 40 | { 41 | return -1; 42 | } 43 | 44 | 45 | int uart_net_write(struct uart_device *uart_dev, void *buf, size_t count) 46 | { 47 | return -1; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_trap.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Trap instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | Vector | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int TRAPTime=15; 23 | 24 | 25 | INSTRUCTION_2ARGS(TRAP, 26 | unsigned Code1,12, 27 | unsigned Vector,4); 28 | 29 | 30 | static void execute(void) 31 | { 32 | TRAP_Instr Instr; 33 | Memory_RetrWordFromPC(&Instr.Code); 34 | 35 | 36 | /* this is done in the exception 37 | SRBits->T=0; 38 | SRBits->S=1; */ 39 | exception_do_exception(32+Instr.Bits.Vector); 40 | 41 | cycle(TRAPTime); 42 | 43 | return; 44 | } 45 | 46 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 47 | { 48 | TRAP_Instr Instr; 49 | Memory_RetrWordFromPC(&Instr.Code); 50 | sprintf(Instruction, "TRAP"); 51 | sprintf(Arg1, "#0x%02X", Instr.Bits.Vector); 52 | Arg2[0]=0; 53 | return 0; 54 | } 55 | 56 | int trap_5206_register(void) 57 | { 58 | instruction_register(0x4E40, 0xFFF0, &execute, &disassemble); 59 | return 1; 60 | } 61 | -------------------------------------------------------------------------------- /arch/mips/common/mipsdef.h: -------------------------------------------------------------------------------- 1 | #ifndef _MIPSDEFS_H_ 2 | #define _MIPSDEFS_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "inttypes.h" 8 | 9 | #define MAX_STR 1024 10 | #define MAX_BANK 8 11 | #define ROM_BANKS 16 12 | 13 | typedef struct mips_mem_bank_s 14 | { 15 | UInt32 (*read_byte) (UInt32 addr); 16 | void (*write_byte) (UInt32 addr, UInt32 data); 17 | UInt32 (*read_halfword) (UInt32 addr); 18 | void (*write_halfword) (UInt32 addr, UInt32 data); 19 | UInt32 (*read_word) (UInt32 addr); 20 | void (*write_word) (UInt32 addr, UInt32 data); 21 | 22 | UInt64 (*read_doubleword) (UInt32 addr); //Maybe unusable for MIPS 23 | void (*write_doubleword) (UInt32 addr, UInt64 data); 24 | 25 | unsigned long addr, len; 26 | char filename[MAX_STR]; 27 | unsigned type; //chy 2003-09-21: maybe io,ram,rom 28 | }mips_mem_bank_t; 29 | 30 | 31 | typedef struct mips_mem_config_s 32 | { 33 | int bank_num; 34 | int current_num; //current num of bank 35 | mips_mem_bank_t mem_banks[MAX_BANK]; 36 | }mips_mem_config_t; 37 | 38 | 39 | typedef struct mips_mem_state_s 40 | { 41 | UInt32 *dram; 42 | UInt32 *rom[ROM_BANKS]; //Shi yang 2006-08-24 43 | UInt32 rom_size[ROM_BANKS]; 44 | //teawater add for arm2x86 2004.12.04------------------------------------------- 45 | UInt8 *tbp[ROM_BANKS]; //translate block pointer 46 | struct tb_s *tbt[ROM_BANKS]; //translate block structure pointer 47 | //AJ2D-------------------------------------------------------------------------- 48 | 49 | }mips_mem_state_t; 50 | 51 | #endif //end of _MIPSDEF_H_ 52 | -------------------------------------------------------------------------------- /utils/portable/win32/gettimeofday.c: -------------------------------------------------------------------------------- 1 | /* 2 | gettimeofday.c - portable gettimeofday function for skyeye on Win32 3 | Copyright (C) 2007 Anthony Lee 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | /* 21 | * 03/03/2007 written by Anthony Lee 22 | */ 23 | 24 | #include 25 | #include "utils/portable/gettimeofday.h" 26 | 27 | int gettimeofday(struct timeval *tv, struct timezone *tz) 28 | { 29 | FILETIME CurrentTime; 30 | __int64 cur_time; 31 | 32 | if(tv == NULL || tz != NULL) return -1; 33 | 34 | GetSystemTimeAsFileTime(&CurrentTime); 35 | cur_time = ((__int64)CurrentTime.dwHighDateTime << 32) + (__int64)CurrentTime.dwLowDateTime; 36 | cur_time -= 116444736000000000LL; 37 | cur_time /= 10LL; 38 | 39 | tv->tv_sec = (cur_time / 1000000LL); 40 | tv->tv_usec = (cur_time % 1000000LL); 41 | 42 | return 0; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_halt.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* HALT instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int HALTTime=7; /* minimum time to halt per Sue Cozart */ 23 | 24 | 25 | INSTRUCTION_1ARG(HALT, 26 | unsigned Code,16); 27 | 28 | static void execute(void) 29 | { 30 | HALT_Instr Instr; 31 | Memory_RetrWordFromPC(&Instr.Code); 32 | 33 | if(SRBits->S) { 34 | /* Supervisor State */ 35 | ERR("Halting the processor:\n"); 36 | return; 37 | } else { 38 | /* User state */ 39 | /* FIXME: Generate an exception violation here */ 40 | } 41 | 42 | cycle(HALTTime); 43 | return; 44 | } 45 | 46 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 47 | { 48 | HALT_Instr Instr; 49 | Memory_RetrWordFromPC(&Instr.Code); 50 | 51 | sprintf(Instruction, "HALT"); 52 | 53 | Arg1[0]=0; 54 | Arg2[0]=0; 55 | 56 | return 0; 57 | } 58 | 59 | int halt_5206_register(void) 60 | { 61 | instruction_register(0x4AC8, 0xFFFF, &execute, &disassemble); 62 | return 1; 63 | } 64 | -------------------------------------------------------------------------------- /arch/arm/dbct/arm2x86_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | /* 17 | * author teawater 18 | */ 19 | 20 | #ifndef _ARM2X86_TEST_H_ 21 | #define _ARM2X86_TEST_H_ 22 | 23 | extern op_table_t op_test_dataabort; 24 | extern op_table_t op_test_dataabort_ret; 25 | extern op_table_t op_test_cpsr_ret_UNP; 26 | //extern op_table_t op_test_debug; 27 | extern int arm2x86_test_init (); 28 | 29 | static __inline__ void 30 | gen_op_test_dataabort_im (ARMul_State * state, uint8_t ** tbpp, int *plen, 31 | uint32_t im) 32 | { 33 | GEN_OP (*tbpp, *plen, op_test_dataabort); 34 | //teawater remove tb_translate_find 2005.10.21---------------------------------- 35 | //if (*tbpp) { 36 | memcpy(*tbpp - sizeof(im), &im, sizeof(im)); 37 | //} 38 | //AJ2D-------------------------------------------------------------------------- 39 | } 40 | 41 | #endif //_ARM2X86_TEST_H_ 42 | -------------------------------------------------------------------------------- /arch/ppc/common/ppc_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | ppc_io.h - necessary io function definition for powerpc 3 | Copyright (C) 2003-2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 04/26/2006 Michael.Kang 23 | */ 24 | 25 | #ifndef __PPC_IO_H__ 26 | #define __PPC_IO_H__ 27 | 28 | uint32_t ppc_read_byte(void * state, uint32_t addr); 29 | uint32_t ppc_read_halfword(void * state,uint32_t addr); 30 | 31 | uint32_t ppc_read_word(void * state, uint32_t addr); 32 | void ppc_write_byte(void * state, uint32_t addr, uint32_t data); 33 | void ppc_write_halfword(void * state, uint32_t addr,uint32_t data); 34 | void ppc_write_word(void * state,uint32_t addr,uint32_t data); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /arch/bfin/common/dma.h: -------------------------------------------------------------------------------- 1 | /* 2 | dma.h - necessary arm definition for skyeye debugger 3 | Copyright (C) 2003-2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 12/16/2006 Michael.Kang 23 | */ 24 | 25 | #ifndef __DMA_H__ 26 | #define __DMA_H__ 27 | 28 | #define BF533_MDMA_D0 8 29 | #define BF533_MDMA_S0 9 30 | #define BF533_MDMA_D1 10 31 | #define BF533_MDMA_S1 11 32 | 33 | #define BF537_MDMA_D0 0xc 34 | #define BF537_MDMA_S0 0xd 35 | #define BF537_MDMA_D1 0xe 36 | #define BF537_MDMA_S1 0xf 37 | 38 | #define START_ADDR 0x1 39 | #define DMA_CONFIG 0x2 40 | #define X_COUNT 0x4 41 | #define X_MODIFY 0x5 42 | #define Y_COUNT 0x6 43 | #define Y_MODIFY 0x7 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /arch/ppc/common/ppc_io.c: -------------------------------------------------------------------------------- 1 | /* 2 | ppc_io.c - necessary arm definition for skyeye debugger 3 | Copyright (C) 2003-2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 04/26/2006 Michael.Kang 23 | */ 24 | 25 | #include 26 | uint32_t ppc_read_byte(void * state, uint32_t addr){ 27 | return 0; 28 | } 29 | uint32_t ppc_read_halfword(void * state,uint32_t addr){ 30 | return 0; 31 | } 32 | uint32_t ppc_read_word(void * state, uint32_t addr){ 33 | return 0; 34 | } 35 | void ppc_write_byte(void * state, uint32_t addr, uint32_t data){} 36 | void ppc_write_halfword(void * state, uint32_t addr,uint32_t data){} 37 | void ppc_write_word(void * state,uint32_t addr,uint32_t data){} 38 | -------------------------------------------------------------------------------- /utils/config/skyeye_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_types.h - some data types definition for skyeye debugger 3 | Copyright (C) 2003 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 12/16/2006 Michael.Kang 23 | */ 24 | 25 | #ifndef __SKYEYE_TYPES_H 26 | #define __SKYEYE_TYPES_H 27 | 28 | #include 29 | 30 | /*default machine word length */ 31 | 32 | #define WORD uint32_t 33 | typedef struct _arch_s 34 | { 35 | void (*init) (); 36 | void (*reset) (); 37 | void (*step_once) (); 38 | void (*set_pc)(WORD addr); 39 | WORD (*get_pc)(); 40 | //chy 2004-04-15 41 | int (*ICE_write_byte) (WORD addr, uint8_t v); 42 | int (*ICE_read_byte)(WORD addr, uint8_t *pv); 43 | } generic_arch_t; 44 | #endif 45 | -------------------------------------------------------------------------------- /arch/arm/common/mmu/sa_mmu.h: -------------------------------------------------------------------------------- 1 | /* 2 | sa_mmu.h - StrongARM Memory Management Unit emulation. 3 | ARMulator extensions for SkyEye. 4 | 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | #ifndef _SA_MMU_H_ 22 | #define _SA_MMU_H_ 23 | 24 | typedef struct sa_mmu_s 25 | { 26 | tlb_t i_tlb; 27 | cache_t i_cache; 28 | 29 | tlb_t d_tlb; 30 | cache_t main_d_cache; 31 | cache_t mini_d_cache; 32 | rb_t rb_t; 33 | wb_t wb_t; 34 | } sa_mmu_t; 35 | 36 | #define I_TLB() (&state->mmu.u.sa_mmu.i_tlb) 37 | #define I_CACHE() (&state->mmu.u.sa_mmu.i_cache) 38 | 39 | #define D_TLB() (&state->mmu.u.sa_mmu.d_tlb) 40 | #define MAIN_D_CACHE() (&state->mmu.u.sa_mmu.main_d_cache) 41 | #define MINI_D_CACHE() (&state->mmu.u.sa_mmu.mini_d_cache) 42 | #define WB() (&state->mmu.u.sa_mmu.wb_t) 43 | #define RB() (&state->mmu.u.sa_mmu.rb_t) 44 | 45 | extern mmu_ops_t sa_mmu_ops; 46 | #endif /*_SA_MMU_H_*/ 47 | -------------------------------------------------------------------------------- /utils/config/skyeye_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_defs.h - some nessisary header files for skyeye 3 | Copyright (C) 2003 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 12/18/2006 Michael.Kang 23 | */ 24 | 25 | 26 | #ifndef __SKYEYE_DEFS_H__ 27 | #define __SKYEYE_DEFS_H__ 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #ifndef FALSE 43 | 44 | #define FALSE 0 45 | #define TRUE 1 46 | #endif 47 | #define LOW 0 48 | #define HIGH 1 49 | #define LOWHIGH 1 50 | #define HIGHLOW 2 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_neg.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Negate instruction (NEG) */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int NEGTime=1; 23 | 24 | 25 | INSTRUCTION_2ARGS(NEG, 26 | unsigned Code1,13, 27 | unsigned Register,3); 28 | 29 | static void execute(void) 30 | { 31 | struct _Address Destination; 32 | unsigned int Result, DValue; 33 | NEG_Instr Instr; 34 | Memory_RetrWordFromPC(&Instr.Code); 35 | 36 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 37 | EA_GetValue(&DValue, &Destination); 38 | 39 | Result = 0 - DValue; 40 | 41 | 42 | /* Set the status register */ 43 | SR_Set(I_NEG, 0, DValue, Result); 44 | 45 | EA_PutValue(&Destination, Result); 46 | 47 | 48 | cycle(NEGTime); 49 | 50 | return; 51 | } 52 | 53 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 54 | { 55 | NEG_Instr Instr; 56 | Memory_RetrWordFromPC(&Instr.Code); 57 | sprintf(Instruction, "NEG.L"); 58 | Addressing_Print(32, 0, Instr.Bits.Register, Arg1); 59 | Arg2[0]=0; 60 | return 0; 61 | } 62 | 63 | int neg_5206_register(void) 64 | { 65 | instruction_register(0x4480, 0xFFF8, &execute, &disassemble); 66 | return 1; 67 | } 68 | -------------------------------------------------------------------------------- /device/lcd/dev_lcd_ep7312.h: -------------------------------------------------------------------------------- 1 | /* 2 | dev_lcd_ep7312.h - skyeye EP7312 lcd controllor simulation 3 | Copyright (C) 2003 - 2005 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 06/23/2005 initial version 23 | * walimis 24 | * */ 25 | #ifndef __DEV_LCD_EP7312_H_ 26 | #define __DEV_LCD_EP7312_H_ 27 | 28 | 29 | #define VBUFSIZ 0x00001fff /* Video buffer size (bits/128-1) */ 30 | #define LINELEN 0x0007e000 /* Line length (pix/16-1) */ 31 | #define LINELEN_SHIFT 13 32 | #define PIXPSC 0x01f80000 /* Pixel prescale (526628/pixels-1) */ 33 | #define PIXPSC_SHIFT 19 34 | #define ACPSC 0x3e000000 /* AC prescale */ 35 | #define ACPSC_SHIFT 25 36 | #define GSEN 0x40000000 /* Grayscale enable (0: monochrome) */ 37 | #define GSMD 0x80000000 /* Grayscale mode (0: 2 bit, 1: 4 bit) */ 38 | 39 | typedef struct lcd_ep7312_io 40 | { 41 | u32 lcdcon; 42 | } lcd_ep7312_io_t; 43 | 44 | 45 | #endif //_DEV_LCD_EP7312_H_ 46 | -------------------------------------------------------------------------------- /device/flash/skyeye_flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_flash.h - skyeye general flash device file support functions 3 | Copyright (C) 2003 - 2005 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | 22 | #ifndef __SKYEYE_FLASH_H_ 23 | #define __SKYEYE_FLASH_H_ 24 | 25 | #include "skyeye_device.h" 26 | 27 | 28 | struct flash_device 29 | { 30 | int mod; 31 | char dump[MAX_STR_NAME]; 32 | 33 | void *state; 34 | 35 | void *priv; 36 | 37 | int (*flash_open) (struct flash_device * flash_dev); 38 | int (*flash_close) (struct flash_device * flash_dev); 39 | int (*flash_update) (struct flash_device * flash_dev); 40 | int (*flash_read) (struct flash_device * flash_dev, void *buf, 41 | size_t count); 42 | int (*flash_write) (struct flash_device * flash_dev, void *buf, 43 | size_t count); 44 | }; 45 | 46 | /* helper functions */ 47 | int skyeye_flash_dump (const char *filename, uint32_t base, uint32_t size); 48 | 49 | 50 | #endif /*__SKYEYE_FLASH_H_*/ 51 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_negx.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Negate with Excend (NEGX) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int NEGXTime=1; 23 | 24 | 25 | INSTRUCTION_2ARGS(NEGX, 26 | unsigned Code1,13, 27 | unsigned Register,3); 28 | 29 | static void execute(void) 30 | { 31 | struct _Address Destination; 32 | unsigned int Result, DValue; 33 | NEGX_Instr Instr; 34 | 35 | Memory_RetrWordFromPC(&Instr.Code); 36 | 37 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 38 | EA_GetValue(&DValue, &Destination); 39 | 40 | Result = 0 - DValue - (unsigned int)SRBits->X; 41 | 42 | 43 | SR_Set(I_NEGX, 0, DValue, Result); 44 | 45 | EA_PutValue(&Destination, Result); 46 | 47 | cycle(NEGXTime); 48 | 49 | return; 50 | } 51 | 52 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 53 | { 54 | NEGX_Instr Instr; 55 | Memory_RetrWordFromPC(&Instr.Code); 56 | 57 | sprintf(Instruction, "NEGX.L"); 58 | Addressing_Print(32, 0, Instr.Bits.Register, Arg1); 59 | Arg2[0]=0; 60 | return 0; 61 | } 62 | 63 | int negx_5206_register(void) 64 | { 65 | instruction_register(0x4080, 0xFFF8, &execute, &disassemble); 66 | return 1; 67 | } 68 | -------------------------------------------------------------------------------- /arch/arm/dbct/arm2x86_self.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | /* 17 | * author teawater 18 | */ 19 | 20 | #ifndef _ARM2X86_SELF_H_ 21 | #define _ARM2X86_SELF_H_ 22 | 23 | #define AREG_st "ebp" 24 | #define AREG_T0 "ebx" 25 | #define AREG_T1 "esi" 26 | #define AREG_T2 "edi" 27 | register ARMul_State *st asm (AREG_st); 28 | //register struct ARMul_State *st asm(AREG_st); 29 | register uint32_t T0 asm (AREG_T0); 30 | register uint32_t T1 asm (AREG_T1); 31 | register uint32_t T2 asm (AREG_T2); 32 | 33 | #define NFLAG_reg st->NFlag 34 | #define ZFLAG_reg st->ZFlag 35 | #define CFLAG_reg st->CFlag 36 | #define VFLAG_reg st->VFlag 37 | //teawater change for debug function 2005.07.26--------------------------------- 38 | #define QFLAG_reg st->SFlag 39 | //AJ2D-------------------------------------------------------------------------- 40 | 41 | #define CP_ACCESS_ALLOWED(STATE, CP) \ 42 | ( ((CP) >= 14) \ 43 | || (! (STATE)->is_XScale) \ 44 | || (xscale_cp15_cp_access_allowed(STATE,15,CP))) 45 | 46 | #endif //_ARM2X86_SELF_H_ 47 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_jmp.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Jump (JMP) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | EAMode | EARegister| 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int JMPTime[8]={-1, 3, -1, -1, 3, 4, 3, -1}; 23 | 24 | 25 | INSTRUCTION_3ARGS(JMP, 26 | unsigned Code1,10, 27 | unsigned EAMode,3, 28 | unsigned EARegister,3); 29 | 30 | static void execute(void) 31 | { 32 | struct _Address Destination; 33 | unsigned int DValue; 34 | JMP_Instr Instr; 35 | Memory_RetrWordFromPC(&Instr.Code); 36 | 37 | 38 | 39 | if(!EA_GetFromPC(&Destination, 32, Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 40 | EA_GetEA(&DValue, &Destination); 41 | 42 | 43 | 44 | /* Set the new PC */ 45 | memory_core.pc=DValue; 46 | 47 | cycle(JMPTime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 48 | 49 | return; 50 | } 51 | 52 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 53 | { 54 | JMP_Instr Instr; 55 | Memory_RetrWordFromPC(&Instr.Code); 56 | sprintf(Instruction, "JMP"); 57 | Addressing_Print(32, Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 58 | Arg2[0]=0; 59 | return 0; 60 | } 61 | 62 | int jmp_5206_register(void) 63 | { 64 | instruction_register(0x4EC0, 0xFFC0, &execute, &disassemble); 65 | return 1; 66 | } 67 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_not.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* NOT instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 0 1 1 0 1 0 0 0 0 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int NOTTime=1; 23 | 24 | 25 | INSTRUCTION_2ARGS(NOT, 26 | unsigned Code1,13, 27 | unsigned Register,3); 28 | 29 | static void execute(void) 30 | { 31 | struct _Address Destination; 32 | unsigned int Result, DValue; 33 | NOT_Instr Instr; 34 | Memory_RetrWordFromPC(&Instr.Code); 35 | 36 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 37 | EA_GetValue(&DValue, &Destination); 38 | 39 | Result = ~DValue; 40 | 41 | /* Set the status register */ 42 | memory_core.sr &= 0xFFF0; 43 | SRBits->N = ((int)Result < 0); 44 | SRBits->Z = (Result == 0); 45 | 46 | EA_PutValue(&Destination, Result); 47 | 48 | 49 | cycle(NOTTime); 50 | 51 | return; 52 | } 53 | 54 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 55 | { 56 | NOT_Instr Instr; 57 | Memory_RetrWordFromPC(&Instr.Code); 58 | sprintf(Instruction, "NOT.L"); 59 | Addressing_Print(32, 0, Instr.Bits.Register, Arg1); 60 | Arg2[0]=0; 61 | return 0; 62 | 63 | } 64 | 65 | int not_5206_register(void) 66 | { 67 | instruction_register(0x4680, 0xFFF8, &execute, &disassemble); 68 | return 1; 69 | } 70 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_pea.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Push Effective Address (pea) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | EAMode | EARegister| 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int PEATime[8]={-1, 2, -1, -1, 2, 3, 2, -1}; 23 | 24 | 25 | INSTRUCTION_3ARGS(PEA, 26 | unsigned Code1,10, 27 | unsigned EAMode,3, 28 | unsigned EARegister,3); 29 | 30 | static void execute(void) 31 | { 32 | struct _Address Source; 33 | unsigned int SValue; 34 | PEA_Instr Instr; 35 | Memory_RetrWordFromPC(&Instr.Code); 36 | 37 | /* Retrive the effective address, not the value that the EA points to */ 38 | if(!EA_GetFromPC(&Source, 32, Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 39 | EA_GetEA(&SValue, &Source); 40 | Stack_Push(32,SValue); 41 | 42 | 43 | cycle(PEATime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 44 | 45 | return; 46 | } 47 | 48 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 49 | { 50 | PEA_Instr Instr; 51 | Memory_RetrWordFromPC(&Instr.Code); 52 | sprintf(Instruction, "PEA"); 53 | Addressing_Print(32, Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 54 | Arg2[0]=0; 55 | return 0; 56 | } 57 | 58 | int pea_5206_register(void) 59 | { 60 | instruction_register(0x4840, 0xFFC0, &execute, &disassemble); 61 | return 1; 62 | } 63 | -------------------------------------------------------------------------------- /arch/bfin/common/mem_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | mem_map.h - memory map of bf533 3 | Copyright (C) 2003 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 01/12/2007 Michael.Kang 23 | */ 24 | 25 | #ifndef __MEM_MAP_H__ 26 | #define __MEM_MAP_H__ 27 | 28 | #define IO_START 0xffc00000 29 | #define IO_END 0xffffffff 30 | 31 | #define ISRAM_SIZE 0x14000 32 | #define ISRAM_START 0xFFA00000 33 | #define ISRAM_END (ISRAM_START+ISRAM_SIZE) 34 | 35 | #define DSRAM_SIZE 0x18000 36 | #define DSRAM_START 0xFF800000 37 | #define DSRAM_END (DSRAM_START+DSRAM_SIZE) 38 | 39 | //psw 061606 scratchpad 40 | #define SSRAM_SIZE 0x1000 41 | #define SSRAM_START 0xFFB00000 42 | #define SSRAM_END (SSRAM_START+SSRAM_SIZE) 43 | 44 | #define BANK0_START 0x20000000 45 | #define BANK3_END 0x20400000 46 | 47 | #define SDRAM_START 0x0 48 | #define SDRAM_END 0x08000000 49 | #define SDRAM_SIZE (SDRAM_END-SDRAM_START) 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /arch/mips/common/multiply.c: -------------------------------------------------------------------------------- 1 | #include "emul.h" 2 | // Perform long multiplication of x by y. 3 | 4 | extern MIPS_State * mstate; 5 | 6 | void 7 | multiply_UInt64(UInt64 u, UInt64 v) 8 | { 9 | UInt64 u0 = bits(u, 31, 0); 10 | UInt64 u1 = bits(u, 63, 32); 11 | 12 | UInt64 v0 = bits(v, 31, 0); 13 | UInt64 v1 = bits(v, 63, 32); 14 | 15 | UInt64 w0 = 0; 16 | UInt64 w1 = 0; 17 | UInt64 w2; 18 | UInt64 w3; 19 | 20 | UInt64 t, k; 21 | 22 | k = 0; 23 | 24 | // i == 0, j == 0 25 | t = u0 * v0 + w0 + k; 26 | w0 = bits(t, 31, 0); 27 | k = bits(t, 63, 32); 28 | 29 | // i == 1, j == 0 30 | t = u1 * v0 + w1 + k; 31 | w1 = bits(t, 31, 0); 32 | k = bits(t, 63, 32); 33 | 34 | w2 = k; 35 | k = 0; 36 | 37 | // i == 0, j == 1 38 | t = u0 * v1 + w1 + k; 39 | w1 = bits(t, 31, 0); 40 | k = bits(t, 63, 32); 41 | 42 | // j == 1, i == 1 43 | t = u1 * v1 + w2 + k; 44 | w2 = bits(t, 31, 0); 45 | k = bits(t, 63, 32); 46 | 47 | w3 = k; 48 | 49 | // Glue the bits back into full words. 50 | mstate->lo = w0 | (w1 << 32); 51 | mstate->hi = w2 | (w3 << 32); 52 | } 53 | 54 | void 55 | multiply_Int64(Int64 u, Int64 v) 56 | { 57 | // Compute the sign of the result; 58 | int neg; 59 | if (u < 0) { 60 | if (v < 0) { 61 | neg =0; 62 | v = -v; 63 | } else { 64 | neg = 1; 65 | } 66 | u = -u; 67 | } else { 68 | if (v < 0) { 69 | neg = 1; 70 | v = -v; 71 | } else { 72 | neg =0; 73 | } 74 | } 75 | multiply_UInt64((UInt64)u, (UInt64)v); 76 | if (neg) { 77 | mstate->lo = ~mstate->lo; 78 | mstate->hi = ~mstate->hi; 79 | if (++mstate->lo == 0) { 80 | ++mstate->hi; 81 | } 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_stop.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | /* FIXME: Unverified correct operation */ 10 | #include "coldfire.h" 11 | 12 | /* Stop (STOP) instruction */ 13 | /* MHM July 13, 2000 */ 14 | /* Format 15 | 16 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 17 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 18 | | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 19 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 20 | 21 | */ 22 | 23 | int STOPTime=3; 24 | 25 | 26 | INSTRUCTION_1ARG(STOP, 27 | unsigned Code1,16); 28 | 29 | static void execute(void) 30 | { 31 | struct _Address Source; 32 | unsigned int Result, SValue; 33 | STOP_Instr Instr; 34 | Memory_RetrWordFromPC(&Instr.Code); 35 | 36 | if(!EA_GetFromPC(&Source, 16, 7, 4)) return; 37 | EA_GetValue(&SValue, &Source); 38 | 39 | Result = SValue; 40 | 41 | 42 | 43 | /* Set the status register */ 44 | memory_core.sr=Result; /* Not quite finished yet */ 45 | 46 | 47 | cycle(STOPTime); 48 | 49 | return; 50 | } 51 | 52 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 53 | { 54 | STOP_Instr Instr; 55 | unsigned int SValue; 56 | Memory_RetrWordFromPC(&Instr.Code); 57 | sprintf(Instruction, "STOP"); 58 | Memory_RetrWordFromPC(&SValue); 59 | sprintf(Arg1, "#$%08lx", SValue); 60 | Arg2[0]=0; 61 | /* Addressing_Print(32, 0, Instr.Bits.Register, Arg2); */ 62 | return 0; 63 | } 64 | 65 | int stop_5206_register(void) 66 | { 67 | instruction_register(0x4E72, 0xFFFF, &execute, &disassemble); 68 | return 1; 69 | } 70 | -------------------------------------------------------------------------------- /arch/ppc/common/ppc_e500_exc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ppc_e500_exc.h - necessary definition for e500 exception 3 | Copyright (C) 2003-2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 07/04/2007 Michael.Kang 23 | */ 24 | /* 25 | IVOR0 Critical Input 26 | IVOR1 Machine Check 27 | IVOR2 Data Storage 28 | IVOR3 Instruction Storage 29 | IVOR4 External Input 30 | IVOR5 Alignment 31 | IVOR6 Program 32 | IVOR7 Floating-Point Unavailable 33 | IVOR8 System Call 34 | IVOR9 Auxiliary Processor Unavailable 35 | IVOR10 Decrementer 36 | IVOR11 Fixed-Interval Timer Interrupt 37 | IVOR12 Watchdog Timer Interrupt 38 | IVOR13 Data TLB Error 39 | IVOR14 Instruction TLB Error 40 | IVOR15 Debug 41 | */ 42 | enum { 43 | CRI_INPUT = 0, 44 | MACH_CHECK, 45 | DATA_ST, 46 | INSN_ST, 47 | EXT_INT, 48 | ALIGN, 49 | PROG, 50 | FP_UN, 51 | SYSCALL, 52 | AP_UN, 53 | DEC, 54 | FIT, 55 | WD, 56 | DATA_TLB, 57 | INSN_TLB, 58 | DEBUG 59 | }; 60 | -------------------------------------------------------------------------------- /arch/arm/dbct/arm2x86_coproc.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | /* 17 | * author teawater 18 | */ 19 | 20 | #ifndef _ARM2X86_COPROC_H_ 21 | #define _ARM2X86_COPROC_H_ 22 | 23 | extern op_table_t op_ldc_T0_T1; 24 | extern op_table_t op_stc_T0_T1; 25 | extern op_table_t op_mrc_T0_T1; 26 | extern op_table_t op_mcr_T0_T1; 27 | extern op_table_t op_cdp_T0_T1; 28 | 29 | //teawater add for xscale(arm v5) 2005.09.12------------------------------------ 30 | extern op_table_t op_mar_T0_T1; 31 | extern op_table_t op_mra_T0_T1; 32 | extern op_table_t op_mia_T0_T1; 33 | extern op_table_t op_miaph_T0_T1; 34 | extern op_table_t op_miaxy_T0_T1; 35 | //AJ2D-------------------------------------------------------------------------- 36 | 37 | extern int arm2x86_coproc_init (); 38 | 39 | static __inline__ void 40 | gen_op_add_imm_offset (ARMul_State * state, uint8_t ** tbpp, int *plen, 41 | ARMword insn) 42 | { 43 | int offset = (insn & 0xff) * 4; 44 | 45 | if (!(insn & (1 << 23))) //U 46 | offset = -offset; 47 | if (offset != 0) 48 | gen_op_addl_T1_im (state, tbpp, plen, (ARMword) offset); 49 | } 50 | 51 | #endif //_ARM2X86_COPROC_H_ 52 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_jsr.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Jump To Subroutine (JSR) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | EAMode | EARegister| 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int JSRTime[8]={-1, 3, -1, -1, 3, 4, 3, -1}; 23 | 24 | 25 | INSTRUCTION_3ARGS(JSR, 26 | unsigned Code1,10, 27 | unsigned EAMode,3, 28 | unsigned EARegister,3); 29 | 30 | static void execute(void) 31 | { 32 | struct _Address Destination; 33 | unsigned int DValue; 34 | JSR_Instr Instr; 35 | Memory_RetrWordFromPC(&Instr.Code); 36 | 37 | if(!EA_GetFromPC(&Destination, 32, Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 38 | EA_GetEA(&DValue, &Destination); 39 | 40 | Stack_Push(32,memory_core.pc); 41 | 42 | /* Set the new PC */ 43 | memory_core.pc=DValue; 44 | 45 | /* Condition codes are not affected */ 46 | 47 | 48 | cycle(JSRTime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 49 | 50 | return; 51 | } 52 | 53 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 54 | { 55 | JSR_Instr Instr; 56 | Memory_RetrWordFromPC(&Instr.Code); 57 | sprintf(Instruction, "JSR"); 58 | Addressing_Print(32, Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 59 | Arg2[0]=0; 60 | return 0; 61 | } 62 | 63 | 64 | int jsr_5206_register(void) 65 | { 66 | instruction_register(0x4E80, 0xFFC0, &execute, &disassemble); 67 | return 1; 68 | } 69 | -------------------------------------------------------------------------------- /utils/portable/gettimeofday.h: -------------------------------------------------------------------------------- 1 | /* 2 | gettimeofday.h - portable gettimeofday function for skyeye 3 | Copyright (C) 2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 03/03/2007 initial version by Anthony Lee 23 | */ 24 | 25 | #ifndef __SKYEYE_GETTIMEOFDAY_H__ 26 | #define __SKYEYE_GETTIMEOFDAY_H__ 27 | 28 | #include /* for gmtime */ 29 | #include /* for struct timeval */ 30 | 31 | #define HAVE_GETTIMEOFDAY 32 | 33 | #if defined(__MINGW32__) 34 | #include <_mingw.h> 35 | #if (__MINGW32_MAJOR_VERSION < 3) 36 | #undef HAVE_GETTIMEOFDAY 37 | #elif (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 10) 38 | #undef HAVE_GETTIMEOFDAY 39 | #endif 40 | #endif /* defined(__MINGW32__) */ 41 | 42 | 43 | #ifndef HAVE_GETTIMEOFDAY 44 | 45 | #if defined(__MINGW32__) 46 | /* we just use timeval, timezone is ignored. */ 47 | struct timezone { 48 | }; 49 | #endif /* defined(__MINGW32__) */ 50 | 51 | int gettimeofday(struct timeval *tv, struct timezone *tz); 52 | 53 | #endif /* HAVE_GETTIMEOFDAY */ 54 | 55 | 56 | #endif /* __SKYEYE_GETTIMEOFDAY_H__ */ 57 | 58 | -------------------------------------------------------------------------------- /utils/main/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | import py2exe 3 | from py2exe.build_exe import py2exe as BuildExe 4 | import os,sys 5 | 6 | def TixInfo(): 7 | import Tkinter 8 | import _tkinter 9 | 10 | tk=_tkinter.create() 11 | 12 | tcl_version=_tkinter.TCL_VERSION 13 | tk_version=_tkinter.TK_VERSION 14 | tix_version=tk.call("package","version","Tix") 15 | 16 | tcl_dir=tk.call("info","library") 17 | 18 | del tk, _tkinter, Tkinter 19 | 20 | return (tcl_version,tk_version,tix_version,tcl_dir) 21 | 22 | class myPy2Exe(BuildExe): 23 | 24 | def plat_finalize(self, modules, py_files, extensions, dlls): 25 | BuildExe.plat_finalize(self, modules, py_files, extensions, dlls) 26 | 27 | if "Tix" in modules: 28 | # Tix adjustments 29 | tcl_version,tk_version,tix_version,tcl_dir = TixInfo() 30 | 31 | tixdll="tix%s%s.dll"% (tix_version.replace(".",""), 32 | tcl_version.replace(".","")) 33 | tcldll="tcl%s.dll"%tcl_version.replace(".","") 34 | tkdll="tk%s.dll"%tk_version.replace(".","") 35 | 36 | dlls.add(os.path.join(sys.prefix,"DLLs",tixdll)) 37 | 38 | self.dlls_in_exedir.extend( [tcldll,tkdll,tixdll ] ) 39 | 40 | tcl_src_dir = os.path.split(tcl_dir)[0] 41 | tcl_dst_dir = os.path.join(self.lib_dir, "tcl") 42 | self.announce("Copying TIX files from %s..." % tcl_src_dir) 43 | self.copy_tree(os.path.join(tcl_src_dir, "tix%s" % tix_version), 44 | os.path.join(tcl_dst_dir, "tix%s" % tix_version)) 45 | 46 | opts={ 47 | 'py2exe':{ 48 | 'bundle_files':1 49 | } 50 | } 51 | 52 | setup( 53 | script_args=['py2exe'], 54 | cmdclass={'py2exe':myPy2Exe}, 55 | windows=['ide.py'], 56 | options=opts, 57 | ) -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_unlk.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Unlink (UNLK) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int UNLKTime=2; 23 | 24 | 25 | INSTRUCTION_2ARGS(UNLK, 26 | unsigned Code1,13, 27 | unsigned Register,3); 28 | 29 | static void execute(void) 30 | { 31 | struct _Address ARegister,Stack; 32 | unsigned int Result; 33 | 34 | UNLK_Instr Instr; 35 | 36 | Memory_RetrWordFromPC(&Instr.Code); 37 | 38 | if(!EA_GetFromPC(&ARegister, 32, 1, Instr.Bits.Register)) return; 39 | if(!EA_GetFromPC(&Stack, 32, 1, 7)) return; 40 | 41 | /* Load the stack pointer from the A register */ 42 | EA_GetValue(&Result, &ARegister); 43 | EA_PutValue(&Stack, Result); 44 | 45 | /* Now pop a longword from the stack and set that to be the 46 | A register */ 47 | Result = Stack_Pop(32); 48 | EA_PutValue(&ARegister, Result); 49 | 50 | 51 | cycle(UNLKTime); 52 | 53 | return; 54 | } 55 | 56 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 57 | { 58 | UNLK_Instr Instr; 59 | Memory_RetrWordFromPC(&Instr.Code); 60 | 61 | sprintf(Instruction, "UNLK"); 62 | Addressing_Print(32, 1, Instr.Bits.Register, Arg1); 63 | Arg2[0]=0; 64 | 65 | return 0; 66 | } 67 | 68 | int unlk_5206_register(void) 69 | { 70 | instruction_register(0x4E58, 0xFFF8, &execute, &disassemble); 71 | return 1; 72 | } 73 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_addi.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Add Immediate (ADDI) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int ADDITime=1; /* All the rest of the modes are not valid */ 23 | 24 | 25 | INSTRUCTION_2ARGS(ADDI, 26 | unsigned Code1,13, 27 | unsigned Register,3); 28 | 29 | static void execute(void) 30 | { 31 | struct _Address Source,Destination; 32 | unsigned int Result, SValue, DValue; 33 | ADDI_Instr Instr; 34 | Memory_RetrWordFromPC(&Instr.Code); 35 | 36 | if(!EA_GetFromPC(&Source, 32, 7, 4)) return; 37 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 38 | 39 | EA_GetValue(&SValue, &Source); 40 | EA_GetValue(&DValue, &Destination); 41 | 42 | Result = SValue + DValue; 43 | 44 | 45 | /* Set the status register */ 46 | SR_Set(I_ADDI, SValue, DValue, Result); 47 | 48 | EA_PutValue(&Destination, Result); 49 | 50 | 51 | cycle(ADDITime); 52 | 53 | return; 54 | } 55 | 56 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 57 | { 58 | ADDI_Instr Instr; 59 | Memory_RetrWordFromPC(&Instr.Code); 60 | sprintf(Instruction, "ADDI.L"); 61 | Addressing_Print(32, 7, 4, Arg1); 62 | Addressing_Print(32, 0, Instr.Bits.Register, Arg2); 63 | return 0; 64 | } 65 | 66 | int addi_5206_register(void) 67 | { 68 | instruction_register(0x0680, 0xFFF8, &execute, &disassemble); 69 | return 1; 70 | } 71 | -------------------------------------------------------------------------------- /device/lcd/dev_lcd_pxa.h: -------------------------------------------------------------------------------- 1 | /* 2 | dev_lcd_pxa.h - skyeye PXA25x lcd controllor simulation 3 | Copyright (C) 2003 - 2005 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 06/23/2005 initial version 23 | * walimis 24 | * */ 25 | #ifndef __DEV_LCD_PXA_H_ 26 | #define __DEV_LCD_PXA_H_ 27 | 28 | /* registers */ 29 | #define LCCR0 0x000000 30 | #define LCCR1 0x000004 31 | #define LCCR2 0x000008 32 | #define LCCR3 0x00000C 33 | 34 | #define FDADR0 0x000200 35 | #define FSADR0 0x000204 36 | #define FIDR0 0x000208 37 | #define LDCMD0 0x00020C 38 | 39 | #define FDADR1 0x000210 40 | #define FSADR1 0x000214 41 | #define FIDR1 0x000218 42 | #define LDCMD1 0x00021C 43 | 44 | 45 | 46 | 47 | #define LCCR0_ENB 0x00000001 48 | #define LCCR1_PPL 0x000003FF 49 | #define LCCR2_LPP 0x000003FF 50 | #define LCCR3_BPP 0x07000000 51 | 52 | 53 | typedef struct lcd_pxa_io 54 | { 55 | u32 lccr0; 56 | u32 lccr1; 57 | u32 lccr2; 58 | u32 lccr3; 59 | 60 | u32 fdadr0; 61 | u32 fdadr1; 62 | 63 | u32 fsadr0; 64 | u32 fsadr1; 65 | 66 | } lcd_pxa_io_t; 67 | 68 | 69 | #endif //_DEV_LCD_PXA_H_ 70 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_subx.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* SubX instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 1 | 0 | 0 | 1 |Register Dx| 1 | 1 | 0 | 0 | 0 | 0 |Register Dy| 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int SUBXTime=1; 23 | 24 | 25 | INSTRUCTION_4ARGS(SUBX, 26 | unsigned Code2,4, 27 | unsigned RegisterDx,3, 28 | unsigned Code1,6, 29 | unsigned RegisterDy,3); 30 | 31 | static void execute(void) 32 | { 33 | struct _Address Source,Destination; 34 | unsigned int Result, SValue, DValue; 35 | SUBX_Instr Instr; 36 | 37 | Memory_RetrWordFromPC(&Instr.Code); 38 | 39 | if(!EA_GetFromPC(&Source, 32, 0, Instr.Bits.RegisterDy)) return; 40 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.RegisterDx)) return; 41 | EA_GetValue(&SValue, &Source); 42 | EA_GetValue(&DValue, &Destination); 43 | 44 | Result = DValue - SValue - (int)SRBits->X; 45 | 46 | 47 | SR_Set(I_SUBX, SValue, DValue, Result); 48 | 49 | EA_PutValue(&Destination, Result); 50 | 51 | cycle(SUBXTime); 52 | 53 | return; 54 | } 55 | 56 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 57 | { 58 | SUBX_Instr Instr; 59 | Memory_RetrWordFromPC(&Instr.Code); 60 | 61 | sprintf(Instruction, "SUBX.L"); 62 | Addressing_Print(32, 0, Instr.Bits.RegisterDy, Arg1); 63 | Addressing_Print(32, 0, Instr.Bits.RegisterDx, Arg2); 64 | return 0; 65 | } 66 | 67 | int subx_5206_register(void) 68 | { 69 | instruction_register(0x9180, 0xF1F8, &execute, &disassemble); 70 | return 1; 71 | } 72 | -------------------------------------------------------------------------------- /utils/config/skyeye_arch.c: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_arch.c - all architecture definition for skyeye 3 | Copyright (C) 2003 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 12/16/2006 Michael.Kang 23 | */ 24 | 25 | #include "skyeye_arch.h" 26 | #include "skyeye_config.h" 27 | #include 28 | 29 | arch_config_t *skyeye_archs[MAX_SUPP_ARCH]; 30 | /* 31 | * register a supported arch to skyeye_archs 32 | */ 33 | void 34 | register_arch (arch_config_t * arch) 35 | { 36 | int i; 37 | for (i = 0; i < MAX_SUPP_ARCH; i++) { 38 | if (skyeye_archs[i] == NULL) { 39 | skyeye_archs[i] = arch; 40 | return; 41 | } 42 | } 43 | } 44 | 45 | extern void init_arm_arch (); 46 | extern void init_bfin_arch (); 47 | extern void init_coldfire_arch (); 48 | extern void init_mips_arch(); 49 | 50 | extern void init_ppc_arch(); 51 | 52 | void 53 | initialize_all_arch () 54 | { 55 | int i; 56 | for (i = 0; i < MAX_SUPP_ARCH; i++) { 57 | skyeye_archs[i] = NULL; 58 | } 59 | /* register arm_arch */ 60 | init_arm_arch (); 61 | 62 | } 63 | -------------------------------------------------------------------------------- /arch/coldfire/tracer/generated.channels.h: -------------------------------------------------------------------------------- 1 | /* We define TRACER_DECLARE(ch) so we can use this list more than once */ 2 | TRACER_DECLARE(ea) 3 | TRACER_DECLARE(exception) 4 | TRACER_DECLARE(handlers) 5 | TRACER_DECLARE(i) 6 | TRACER_DECLARE(i_add) 7 | TRACER_DECLARE(i_adda) 8 | TRACER_DECLARE(i_addi) 9 | TRACER_DECLARE(i_addq) 10 | TRACER_DECLARE(i_addx) 11 | TRACER_DECLARE(i_and) 12 | TRACER_DECLARE(i_andi) 13 | TRACER_DECLARE(i_asx) 14 | TRACER_DECLARE(i_bcc) 15 | TRACER_DECLARE(i_btst) 16 | TRACER_DECLARE(i_clr) 17 | TRACER_DECLARE(i_cmp) 18 | TRACER_DECLARE(i_cmpa) 19 | TRACER_DECLARE(i_cmpi) 20 | TRACER_DECLARE(i_dc) 21 | TRACER_DECLARE(i_div) 22 | TRACER_DECLARE(i_eor) 23 | TRACER_DECLARE(i_eori) 24 | TRACER_DECLARE(i_ext) 25 | TRACER_DECLARE(i_halt) 26 | TRACER_DECLARE(i_illegal) 27 | TRACER_DECLARE(i_jmp) 28 | TRACER_DECLARE(i_jsr) 29 | TRACER_DECLARE(i_lea) 30 | TRACER_DECLARE(i_link) 31 | TRACER_DECLARE(i_lsx) 32 | TRACER_DECLARE(i_move) 33 | TRACER_DECLARE(i_movec) 34 | TRACER_DECLARE(i_movem) 35 | TRACER_DECLARE(i_moveq) 36 | TRACER_DECLARE(i_movexr) 37 | TRACER_DECLARE(i_mulu_l) 38 | TRACER_DECLARE(i_mul_w) 39 | TRACER_DECLARE(i_neg) 40 | TRACER_DECLARE(i_negx) 41 | TRACER_DECLARE(i_nop) 42 | TRACER_DECLARE(i_not) 43 | TRACER_DECLARE(i_or) 44 | TRACER_DECLARE(i_ori) 45 | TRACER_DECLARE(i_pea) 46 | TRACER_DECLARE(i_rte) 47 | TRACER_DECLARE(i_rts) 48 | TRACER_DECLARE(isa) 49 | TRACER_DECLARE(i_scc) 50 | TRACER_DECLARE(i_stop) 51 | TRACER_DECLARE(i_sub) 52 | TRACER_DECLARE(i_suba) 53 | TRACER_DECLARE(i_subi) 54 | TRACER_DECLARE(i_subq) 55 | TRACER_DECLARE(i_subx) 56 | TRACER_DECLARE(i_swap) 57 | TRACER_DECLARE(i_trap) 58 | TRACER_DECLARE(i_trapf) 59 | TRACER_DECLARE(i_tst) 60 | TRACER_DECLARE(i_unlk) 61 | TRACER_DECLARE(main) 62 | TRACER_DECLARE(memory) 63 | TRACER_DECLARE(misc) 64 | TRACER_DECLARE(monitor) 65 | TRACER_DECLARE(network) 66 | TRACER_DECLARE(ram) 67 | TRACER_DECLARE(run) 68 | TRACER_DECLARE(serial) 69 | TRACER_DECLARE(sim) 70 | TRACER_DECLARE(timer) 71 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_lea.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Load Effective Address (lea) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | ARegister | 1 | 1 | 1 | EAMode | EARegister| 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int LEATime[8]={-1, 1, -1, -1, 1, 2, 1, -1}; 23 | 24 | 25 | INSTRUCTION_5ARGS(LEA, 26 | unsigned Code2,4, 27 | unsigned Register,3, 28 | unsigned Code1,3, 29 | unsigned EAMode,3, 30 | unsigned EARegister,3); 31 | 32 | static void execute(void) 33 | { 34 | struct _Address Source,Destination; 35 | unsigned int SValue; 36 | LEA_Instr Instr; 37 | Memory_RetrWordFromPC(&Instr.Code); 38 | 39 | if(!EA_GetFromPC(&Source, 32, Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 40 | if(!EA_GetFromPC(&Destination, 32, 1, Instr.Bits.Register)) return; 41 | 42 | EA_GetEA(&SValue, &Source); 43 | 44 | 45 | /* Condition codes are not affected */ 46 | 47 | EA_PutValue(&Destination, SValue); 48 | 49 | 50 | cycle(LEATime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 51 | 52 | return; 53 | } 54 | 55 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 56 | { 57 | LEA_Instr Instr; 58 | Memory_RetrWordFromPC(&Instr.Code); 59 | sprintf(Instruction, "LEA"); 60 | Addressing_Print(32, Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 61 | Addressing_Print(32, 1, Instr.Bits.Register, Arg2); 62 | return 0; 63 | } 64 | 65 | int lea_5206_register(void) 66 | { 67 | instruction_register(0x41C0, 0xF1C0, &execute, &disassemble); 68 | return 1; 69 | } 70 | -------------------------------------------------------------------------------- /device/nandflash/dev_nandflash_s3c2410.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | /* 17 | * author gbf0871 18 | */ 19 | #ifndef __DEV_NANDFLASH_S3C2410_H_ 20 | #define __DEV_NANDFLASH_S3C2410_H_ 21 | 22 | #define S3C2410_NFCONF_EN (1<<15) 23 | #define S3C2410_NFCONF_512BYTE (1<<14) 24 | #define S3C2410_NFCONF_4STEP (1<<13) 25 | #define S3C2410_NFCONF_INITECC (1<<12) 26 | #define S3C2410_NFCONF_nFCE (1<<11) 27 | #define S3C2410_NFCONF_TACLS(x) ((x)<<8) 28 | #define S3C2410_NFCONF_TWRPH0(x) ((x)<<4) 29 | #define S3C2410_NFCONF_TWRPH1(x) ((x)<<0) 30 | #define NFCONF 0x4E000000 /* NAND flash configuration */ 31 | #define NFCMD 0x4E000004 /* NAND flash command set register */ 32 | #define NFADDR 0x4E000008 /*NAND flash address set register*/ 33 | #define NFDATA 0x4E00000C /* NAND flash data register */ 34 | #define NFSTAT 0x4E000010 /*NAND flash operation status*/ 35 | #define NFECC1 0x4E000014 /* NAND flash ECC (Error Correction Code) register */ 36 | #define NFECC2 0x4E000015 37 | #define NFECC3 0x4E000016 38 | 39 | typedef struct nandflash_s3c2410_io 40 | { 41 | u32 nfconf; 42 | u32 nfcmd; 43 | u32 nfaddr; 44 | u32 nfdata; 45 | u32 nfstat; 46 | u32 nfecc; 47 | } nandflash_s3c2410_io_t; 48 | 49 | 50 | #endif //_DEV_NANDFLASH_S3C2410_H_ 51 | 52 | -------------------------------------------------------------------------------- /misc/auto_test/auto_test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | # 3 | # Author: Michael Kang(blackfin.kang@gmail.com) 4 | # Purpose: autoTest all the testcases in the skyeye testsuite. 5 | # 6 | 7 | set TITLE "SkyEye Auto Test" 8 | 9 | 10 | puts "*********************************\r" 11 | puts "Start $TITLE\r" 12 | puts "*********************************\r" 13 | 14 | #set skyeye_penv(PWD) 15 | 16 | # add directory of all the test case 17 | set path { at91/uclinux_rtl8019/ at91/uclinux_cs8900a at91/at91_with_framebuffer_touchscreen at91rm9200/2.6.x ep7312/2.6.x ep7312/ep7312_with_framebuffer_touchscreen_minigui ep9312/2.6.x s3c2410/2.4.18 s3c4510/ pxa/2.6.x pxa/with_flash_net_lcd pxa/pxa27x cs89712/ strongarm/ blackfin/ 18 | } 19 | set timeout 180 20 | set case_num 1 21 | set failed_num 0 22 | set pass_num 0 23 | set report_date [exec date --iso-8601=date] 24 | # open a file as report 25 | set file [open test_report_$report_date w] 26 | puts $file " SkyEye test report" 27 | puts $file "Date : [exec date]" 28 | puts $file " " 29 | 30 | set skyeye_sh { ./exec_skyeye.sh ./exec_skyeye_dbct.sh } 31 | 32 | foreach skyeye_element $skyeye_sh { 33 | foreach element $path { 34 | spawn $skyeye_element $element $env(PWD) 35 | expect { 36 | # we think when appear "command shell" , testcase is passed 37 | "shell" { 38 | puts $file "Case $case_num: $skyeye_element $element ...PASSED\n" 39 | incr pass_num 40 | } 41 | timeout { 42 | puts $file "Case $case_num: $skyeye_element $element ...FAILED\n" 43 | incr failed_num 44 | } 45 | } 46 | incr case_num 47 | system "killall skyeye" 48 | } 49 | } 50 | 51 | set total_num [expr $case_num-1] 52 | puts " \r" 53 | puts "Total $total_num , failed $failed_num , pass $pass_num " 54 | puts "\r$TITLE ............\r" 55 | # write to a txt file as report 56 | puts $file "Total $total_num , failed $failed_num , pass $pass_num " 57 | -------------------------------------------------------------------------------- /arch/arm/mach/cs89712.h: -------------------------------------------------------------------------------- 1 | /* 2 | * linux/include/asm-arm/hardware/cs89712.h 3 | * 4 | * This file contains the hardware definitions of the CS89712 5 | * additional internal registers. 6 | * 7 | * Copyright (C) 2001 Thomas Gleixner autronix automation 8 | * 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | #ifndef __ASM_HARDWARE_CS89712_H 25 | #define __ASM_HARDWARE_CS89712_H 26 | 27 | /* 28 | * CS89712 additional registers 29 | */ 30 | 31 | #define PCDR 0x0002 /* Port C Data register ---------------------------- */ 32 | #define PCDDR 0x0042 /* Port C Data Direction register ------------------ */ 33 | #define SDCONF 0x2300 /* SDRAM Configuration register --------------------- */ 34 | #define SDRFPR 0x2340 /* SDRAM Refresh period register -------------------- */ 35 | 36 | #define SDCONF_ACTIVE (1 << 10) 37 | #define SDCONF_CLKCTL (1 << 9) 38 | #define SDCONF_WIDTH_4 (0 << 7) 39 | #define SDCONF_WIDTH_8 (1 << 7) 40 | #define SDCONF_WIDTH_16 (2 << 7) 41 | #define SDCONF_WIDTH_32 (3 << 7) 42 | #define SDCONF_SIZE_16 (0 << 5) 43 | #define SDCONF_SIZE_64 (1 << 5) 44 | #define SDCONF_SIZE_128 (2 << 5) 45 | #define SDCONF_SIZE_256 (3 << 5) 46 | #define SDCONF_CASLAT_2 (2) 47 | #define SDCONF_CASLAT_3 (3) 48 | 49 | #endif /* __ASM_HARDWARE_CS89712_H */ 50 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_cmp.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Compare (CMP) instruction */ 12 | 13 | /* Format 14 | 15 | CMP 16 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 17 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 18 | | 1 | 0 | 1 | 1 | Register | 0 | 1 | 0 | EAMode |EARegister | 19 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 20 | 21 | 22 | */ 23 | 24 | int CMPTime[8]={ 1, 3, 3, 3, 3, 4, 3, 1}; 25 | 26 | 27 | INSTRUCTION_5ARGS(CMP, 28 | unsigned Code2,4, 29 | unsigned Register,3, 30 | unsigned Code1,3, 31 | unsigned EAMode,3, 32 | unsigned EARegister,3); 33 | 34 | static void execute(void) 35 | { 36 | struct _Address Source,Destination; 37 | unsigned int Result, SValue, DValue; 38 | CMP_Instr Instr; 39 | Memory_RetrWordFromPC(&Instr.Code); 40 | 41 | if(!EA_GetFromPC(&Source, 32, Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 42 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 43 | 44 | EA_GetValue(&SValue, &Source); 45 | EA_GetValue(&DValue, &Destination); 46 | 47 | 48 | Result = DValue - SValue; 49 | 50 | SR_Set(I_CMP, SValue, DValue, Result); 51 | 52 | cycle(CMPTime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 53 | return; 54 | } 55 | 56 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 57 | { 58 | CMP_Instr Instr; 59 | Memory_RetrWordFromPC(&Instr.Code); 60 | sprintf(Instruction, "CMP.L"); 61 | Addressing_Print(32, Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 62 | Addressing_Print(32, 0, Instr.Bits.Register, Arg2); 63 | return 0; 64 | } 65 | 66 | int cmp_5206_register(void) 67 | { 68 | instruction_register(0xB080, 0xF1C0, &execute, &disassemble); 69 | return 1; 70 | } 71 | -------------------------------------------------------------------------------- /utils/portable/beos/tap_driver/skyeye_tap.h: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_tap.h - A kernel driver for SkyEye's net simulation on BeOS 3 | Copyright (C) 2007 Anthony Lee 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | /* 21 | * 02/01/2007 written by Anthony Lee 22 | */ 23 | 24 | #ifndef __SKYEYE_TAP_BEOS_DRIVER_H__ 25 | #define __SKYEYE_TAP_BEOS_DRIVER_H__ 26 | 27 | #include 28 | 29 | #define SKYEYE_TAP_RX_PORT_NAME "SkyEye_Tap_RX" 30 | #define SKYEYE_TAP_TX_PORT_NAME "SkyEye_Tap_TX" 31 | 32 | #define SKYEYE_TAP_RX_PORT_FOR_USER SKYEYE_TAP_TX_PORT_NAME 33 | #define SKYEYE_TAP_TX_PORT_FOR_USER SKYEYE_TAP_RX_PORT_NAME 34 | #define SKYEYE_TAP_PORT_MSG_CODE 'snet' 35 | 36 | #define SKYEYE_TAP_DEVICE_NAME "net/skyeye_tap/0" 37 | #define SKYEYE_TAP_DEVICE "/dev/" SKYEYE_TAP_DEVICE_NAME 38 | #define SKYEYE_TAP_FRAME_SIZE 1560 39 | 40 | enum 41 | { 42 | ETHER_GETADDR = B_DEVICE_OP_CODES_END, /* get ethernet address */ 43 | ETHER_INIT, /* set irq and port */ 44 | ETHER_NONBLOCK, /* set/unset nonblocking mode */ 45 | ETHER_ADDMULTI, /* add multicast addr */ 46 | ETHER_REMMULTI, /* rem multicast addr */ 47 | ETHER_SETPROMISC, /* set promiscuous */ 48 | ETHER_GETFRAMESIZE, /* get frame size */ 49 | }; 50 | 51 | #endif /* __SKYEYE_TAP_BEOS_DRIVER_H__ */ 52 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_adda.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Add instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 1 | 1 | 0 | 1 | Register | 1 | 1 | 1 | EA Mode |EA Register| 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int ADDATime[]={-1, 3, 3, 3, 3, 4, 3, -1 }; 23 | 24 | 25 | INSTRUCTION_5ARGS(ADDA, 26 | unsigned Code2,4, 27 | unsigned Register,3, 28 | unsigned Code1,3, 29 | unsigned EAMode,3, 30 | unsigned EARegister,3); 31 | 32 | static void execute(void) 33 | { 34 | struct _Address Source,Destination; 35 | unsigned int Result, SValue, DValue; 36 | ADDA_Instr Instr; 37 | Memory_RetrWordFromPC(&Instr.Code); 38 | 39 | if(!EA_GetFromPC(&Source, 32, Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 40 | if(!EA_GetFromPC(&Destination, 32, 1, Instr.Bits.Register)) return; 41 | 42 | EA_GetValue(&SValue, &Source); 43 | EA_GetValue(&DValue, &Destination); 44 | 45 | Result = SValue + DValue; 46 | 47 | 48 | /* Status register is not affected */ 49 | 50 | EA_PutValue(&Destination, Result); 51 | 52 | cycle(ADDATime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 53 | } 54 | 55 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 56 | { 57 | ADDA_Instr Instr; 58 | Memory_RetrWordFromPC(&Instr.Code); 59 | sprintf(Instruction, "ADDA.L"); 60 | Addressing_Print(32, Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 61 | Addressing_Print(32, 1, Instr.Bits.Register, Arg2); 62 | return 0; 63 | } 64 | 65 | int adda_5206_register(void) 66 | { 67 | instruction_register(0xD1C0, 0xF1C0, &execute, &disassemble); 68 | return 1; 69 | } 70 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_addx.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* AddX instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 1 | 1 | 0 | 1 |Register Dx| 1 | 1 | 0 | 0 | 0 | 0 |Register Dy| 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int ADDXTime=1; /* All the rest of the modes are not valid */ 23 | 24 | 25 | 26 | INSTRUCTION_4ARGS(ADDX, 27 | unsigned Code2,4, 28 | unsigned RegisterDx,3, 29 | unsigned Code1,6, 30 | unsigned RegisterDy,3); 31 | 32 | 33 | static void execute(void) 34 | { 35 | struct _Address Source,Destination; 36 | unsigned int Result, SValue, DValue; 37 | int Extend = SRBits->X; 38 | ADDX_Instr Instr; 39 | 40 | Memory_RetrWordFromPC(&Instr.Code); 41 | 42 | if(!EA_GetFromPC(&Source, 32, 0, Instr.Bits.RegisterDy)) return; 43 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.RegisterDx)) return; 44 | EA_GetValue(&SValue, &Source); 45 | EA_GetValue(&DValue, &Destination); 46 | 47 | Result = SValue + DValue + Extend; 48 | 49 | 50 | SR_Set(I_ADDX, SValue, DValue, Result); 51 | 52 | EA_PutValue(&Destination, Result); 53 | 54 | cycle(ADDXTime); 55 | 56 | return; 57 | } 58 | 59 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 60 | { 61 | ADDX_Instr Instr; 62 | Memory_RetrWordFromPC(&Instr.Code); 63 | 64 | sprintf(Instruction, "ADDX.L"); 65 | Addressing_Print(32, 0, Instr.Bits.RegisterDy, Arg1); 66 | Addressing_Print(32, 0, Instr.Bits.RegisterDx, Arg2); 67 | return 0; 68 | } 69 | 70 | int addx_5206_register(void) 71 | { 72 | instruction_register(0xD180, 0xF1F8, &execute, &disassemble); 73 | return 1; 74 | } 75 | -------------------------------------------------------------------------------- /utils/portable/mman.h: -------------------------------------------------------------------------------- 1 | /* 2 | mman.h - portable mmap/munmap function for skyeye 3 | Copyright (C) 2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 01/30/2007 initial version by Anthony Lee 23 | */ 24 | 25 | #ifndef __SKYEYE_PORTABLE_MMAN_H__ 26 | #define __SKYEYE_PORTABLE_MMAN_H__ 27 | 28 | /* 29 | * The mmap/munmap function just for malloc large memory for skyeye. 30 | * When you found that the system don't support the mmap/munmap function, 31 | * please follow the mman.c to see how to write the portable function. 32 | */ 33 | 34 | #if !(defined(__MINGW32__) || defined(__BEOS__)) 35 | 36 | #include 37 | #include 38 | #define HAVE_MMAP_AND_MUNMAP 39 | 40 | #else 41 | 42 | #include 43 | 44 | enum { 45 | PROT_NONE = 0, 46 | PROT_EXEC = 1, 47 | PROT_READ = 2, 48 | PROT_WRITE = 4, 49 | }; 50 | 51 | enum { 52 | MAP_PRIVATE = 0, 53 | MAP_FIXED = 1, 54 | MAP_SHARED = 2, 55 | MAP_ANONYMOUS = 4, 56 | }; 57 | 58 | #define MAP_FAILED ((void*)-1) 59 | 60 | int getpagesize(void); 61 | void* mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); 62 | int munmap(void *addr, size_t length); 63 | 64 | #endif 65 | 66 | #endif /* __SKYEYE_PORTABLE_MMAN_H__ */ 67 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_swap.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Swap register halves (SWAP) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int SWAPTime=1; 23 | 24 | 25 | INSTRUCTION_2ARGS(SWAP, 26 | unsigned Code1,13, 27 | unsigned Register,3); 28 | 29 | static void execute(void) 30 | { 31 | struct _Address Destination; 32 | unsigned int DValue; 33 | unsigned int Tmp; 34 | SWAP_Instr Instr; 35 | Memory_RetrWordFromPC(&Instr.Code); 36 | 37 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 38 | EA_GetValue(&DValue, &Destination); 39 | Tmp = (DValue << 16) & 0xFFFF0000; 40 | Tmp += (DValue >> 16) & 0x0000FFFF; 41 | 42 | EA_PutValue(&Destination, Tmp); 43 | 44 | /* X - Not affected 45 | N - Set if 32bits result is negative 46 | Z - Set if 32bit result is zero 47 | V - Always Cleared 48 | C - Always Cleared 49 | */ 50 | SRBits->N= ((int)Tmp < 0) ? 1 : 0; 51 | SRBits->Z= (Tmp == 0) ? 1 : 0; 52 | SRBits->V=0; 53 | SRBits->C=0; 54 | 55 | cycle(SWAPTime); 56 | 57 | return; 58 | } 59 | 60 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 61 | { 62 | SWAP_Instr Instr; 63 | Memory_RetrWordFromPC(&Instr.Code); 64 | 65 | sprintf(Instruction, "SWAP"); 66 | 67 | Addressing_Print(32, 0, Instr.Bits.Register, Arg1); 68 | Arg2[0]=0; 69 | 70 | return 0; 71 | } 72 | 73 | int swap_5206_register(void) 74 | { 75 | instruction_register(0x4840, 0xFFF8, &execute, &disassemble); 76 | return 1; 77 | } 78 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_cmpa.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Compare address (CMPA) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 1 | 0 | 1 | 1 | Register | 1 | 1 | 1 | EAMode |EARegister | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | int CMPATime[8]={ 1, 3, 3, 3, 3, 4, 3, 1}; 22 | 23 | INSTRUCTION_5ARGS(CMPA, 24 | unsigned Code2,4, 25 | unsigned Register,3, 26 | unsigned Code1,3, 27 | unsigned EAMode,3, 28 | unsigned EARegister,3); 29 | 30 | static void execute(void) 31 | { 32 | struct _Address Source,Destination; 33 | unsigned int Result, SValue, DValue; 34 | CMPA_Instr Instr; 35 | Memory_RetrWordFromPC(&Instr.Code); 36 | 37 | if(!EA_GetFromPC(&Source, 32, Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 38 | if(!EA_GetFromPC(&Destination, 32, 1, Instr.Bits.Register)) return; 39 | 40 | EA_GetValue(&SValue, &Source); 41 | EA_GetValue(&DValue, &Destination); 42 | 43 | Result = DValue - SValue; 44 | 45 | 46 | /* Set the status register */ 47 | SR_Set(I_CMPA, SValue, DValue, Result); 48 | 49 | cycle(CMPATime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 50 | return; 51 | } 52 | 53 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 54 | { 55 | CMPA_Instr Instr; 56 | Memory_RetrWordFromPC(&Instr.Code); 57 | sprintf(Instruction, "CMPA.L"); 58 | Addressing_Print(32, Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 59 | Addressing_Print(32, 1, Instr.Bits.Register, Arg2); 60 | return 0; 61 | } 62 | 63 | int cmpa_5206_register(void) 64 | { 65 | instruction_register(0xB1C0, 0xF1C0, &execute, &disassemble); 66 | return 1; 67 | } 68 | -------------------------------------------------------------------------------- /device/nandflash/dev_nandflash_starlet.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation, version 2. 5 | 6 | This program is distributed in the hope that it will be useful, 7 | but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | GNU General Public License for more details. 10 | 11 | You should have received a copy of the GNU General Public License along 12 | with this program; if not, write to the Free Software Foundation, Inc., 13 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 14 | 15 | /* 16 | * author bushing 17 | */ 18 | #ifndef __DEV_NANDFLASH_STARLET_H_ 19 | #define __DEV_NANDFLASH_STARLET_H_ 20 | 21 | //#define STARLET_NFCONF_EN (1<<15) 22 | //#define STARLET_NFCONF_512BYTE (1<<14) 23 | //#define STARLET_NFCONF_4STEP (1<<13) 24 | //#define STARLET_NFCONF_INITECC (1<<12) 25 | //#define STARLET_NFCONF_nFCE (1<<11) 26 | //#define STARLET_NFCONF_TACLS(x) ((x)<<8) 27 | //#define STARLET_NFCONF_TWRPH0(x) ((x)<<4) 28 | //#define STARLET_NFCONF_TWRPH1(x) ((x)<<0) 29 | #define NFCMD 0x0D010000 /* NAND flash configuration */ 30 | #define NFCONF 0x0D010004 /* NAND flash command set register */ 31 | #define NFADDR0 0x0D010008 /*NAND flash address set register*/ 32 | #define NFADDR1 0x0D01000C /* NAND flash data register */ 33 | #define NFSTAT 0x0D010000 /*NAND flash operation status*/ 34 | #define NF_DATA 0x0D010010 /* NAND flash ECC (Error Correction Code) register */ 35 | #define NF_ECC 0x0D010014 36 | #define NF_UNK1 0x0D010018 37 | #define NF_UNK2 0x0D01001C 38 | 39 | 40 | typedef struct nandflash_starlet_io 41 | { 42 | u32 nfconf; 43 | u32 nfcmd; 44 | u8 address[6]; 45 | u32 nf_addr0, nf_addr1; 46 | u32 nf_data; 47 | u32 nfstat; 48 | u32 nf_ecc; 49 | u32 nf_datasize; 50 | u8 buf[4096]; 51 | } nandflash_starlet_io_t; 52 | 53 | 54 | #endif //_DEV_NANDFLASH_STARLET_H_ 55 | 56 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_moveq.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Move instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 1 | 1 | Register | 0 | Data | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int MOVEQTime=1; 23 | 24 | 25 | INSTRUCTION_4ARGS(MOVEQ, 26 | unsigned Code2,4, 27 | unsigned Register,3, 28 | unsigned Code1,1, 29 | signed Data,8); 30 | 31 | static void execute(void) 32 | { 33 | struct _Address Destination; 34 | unsigned int SValue; 35 | MOVEQ_Instr Instr; 36 | Memory_RetrWordFromPC(&Instr.Code); 37 | 38 | SValue=(unsigned int)Instr.Bits.Data; 39 | 40 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 41 | 42 | EA_PutValue(&Destination, SValue); 43 | 44 | /* X - not affected 45 | N - set if result is -ve, cleared otherwise 46 | Z - set if result is zero, cleared otherwise 47 | V - always cleared 48 | C - always cleared */ 49 | /* Set the status register */ 50 | memory_core.sr &= 0xFFF0; 51 | SRBits->N = ((int)SValue < 0); 52 | SRBits->Z = (SValue == 0); 53 | 54 | 55 | cycle(MOVEQTime); 56 | 57 | return; 58 | } 59 | 60 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 61 | { 62 | MOVEQ_Instr Instr; 63 | Memory_RetrWordFromPC(&Instr.Code); 64 | 65 | sprintf(Instruction, "MOVEQ"); 66 | 67 | sprintf(Arg1, "#0x%02X", ((char)Instr.Bits.Data) & 0x000000FF); 68 | Addressing_Print(32, 0, Instr.Bits.Register, Arg2); 69 | return 0; 70 | } 71 | 72 | int moveq_5206_register(void) 73 | { 74 | instruction_register(0x7000, 0xF100, &execute, &disassemble); 75 | return 1; 76 | } 77 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/temp: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Move instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 1 | 1 | Register | 0 | Data | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int MOVEQTime=1; 23 | 24 | 25 | INSTRUCTION_4ARGS(MOVEQ, 26 | unsigned Code2,4, 27 | unsigned Register,3, 28 | unsigned Code1,1, 29 | signed Data,8); 30 | 31 | static void execute(void) 32 | { 33 | struct _Address Destination; 34 | unsigned long SValue; 35 | MOVEQ_Instr Instr; 36 | Memory_RetrWordFromPC(&Instr.Code); 37 | 38 | SValue=(unsigned long)Instr.Bits.Data; 39 | 40 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 41 | 42 | EA_PutValue(&Destination, SValue); 43 | 44 | /* X - not affected 45 | N - set if result is -ve, cleared otherwise 46 | Z - set if result is zero, cleared otherwise 47 | V - always cleared 48 | C - always cleared */ 49 | /* Set the status register */ 50 | memory_core.sr &= 0xFFF0; 51 | SRBits->N = ((long)SValue < 0); 52 | SRBits->Z = (SValue == 0); 53 | 54 | 55 | cycle(MOVEQTime); 56 | 57 | return; 58 | } 59 | 60 | static long disassemble(char *Instruction, char *Arg1, char *Arg2) 61 | { 62 | MOVEQ_Instr Instr; 63 | Memory_RetrWordFromPC(&Instr.Code); 64 | 65 | sprintf(Instruction, "MOVEQ"); 66 | 67 | sprintf(Arg1, "#0x%02X", ((char)Instr.Bits.Data) & 0x000000FF); 68 | Addressing_Print(32, 0, Instr.Bits.Register, Arg2); 69 | return 0; 70 | } 71 | 72 | long moveq_5206_register(void) 73 | { 74 | instruction_register(0x7000, 0xF100, &execute, &disassemble); 75 | return 1; 76 | } 77 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_suba.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Subtract instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 1 | 0 | 0 | 1 | Register | 1 | 1 | 1 | EA Mode |EA Register| 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int SUBATime[]={-1, 3, 3, 3, 3, 4, 3, -1 }; 23 | 24 | 25 | INSTRUCTION_5ARGS(SUBA, 26 | unsigned Code2,4, 27 | unsigned Register,3, 28 | unsigned Code1,3, 29 | unsigned EAMode,3, 30 | unsigned EARegister,3); 31 | 32 | static void execute(void) 33 | { 34 | struct _Address Source,Destination; 35 | unsigned int Result, SValue, DValue; 36 | SUBA_Instr Instr; 37 | Memory_RetrWordFromPC(&Instr.Code); 38 | 39 | if(!EA_GetFromPC(&Source, 32, Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 40 | if(!EA_GetFromPC(&Destination, 32, 1, Instr.Bits.Register)) return; 41 | 42 | EA_GetValue(&SValue, &Source); 43 | EA_GetValue(&DValue, &Destination); 44 | 45 | Result = DValue - SValue; 46 | 47 | 48 | /* Condition codes are not affected */ 49 | 50 | EA_PutValue(&Destination, Result); 51 | 52 | 53 | cycle(SUBATime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 54 | 55 | return; 56 | } 57 | 58 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 59 | { 60 | SUBA_Instr Instr; 61 | Memory_RetrWordFromPC(&Instr.Code); 62 | sprintf(Instruction, "SUBA.L"); 63 | Addressing_Print(32, Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 64 | Addressing_Print(32, 1, Instr.Bits.Register, Arg2); 65 | return 0; 66 | } 67 | 68 | int suba_5206_register(void) 69 | { 70 | instruction_register(0x91C0, 0xF1C0, &execute, &disassemble); 71 | return 1; 72 | } 73 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_eori.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* EORI Immediate (EORI) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int EORITime=1; 23 | 24 | 25 | INSTRUCTION_2ARGS(EORI, 26 | unsigned Code1,13, 27 | unsigned Register,3); 28 | 29 | static void execute(void) 30 | { 31 | struct _Address Source,Destination; 32 | unsigned int Result, SValue, DValue; 33 | EORI_Instr Instr; 34 | Memory_RetrWordFromPC(&Instr.Code); 35 | 36 | if(!EA_GetFromPC(&Source, 32, 7, 4)) return; 37 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 38 | 39 | EA_GetValue(&SValue, &Source); 40 | EA_GetValue(&DValue, &Destination); 41 | 42 | Result = SValue ^ DValue; 43 | 44 | 45 | EA_PutValue(&Destination, Result); 46 | 47 | /* Set the status register 48 | * X - not affected 49 | * N - set if MSB or result is 1 50 | * Z - set if result is zero 51 | * V,C always cleared 52 | */ 53 | memory_core.sr &= 0xFFF0; 54 | SRBits->N = ((int)Result < 0); 55 | SRBits->Z = (Result == 0); 56 | 57 | cycle(EORITime); 58 | 59 | return; 60 | } 61 | 62 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 63 | { 64 | EORI_Instr Instr; 65 | Memory_RetrWordFromPC(&Instr.Code); 66 | sprintf(Instruction, "EORI.L"); 67 | Addressing_Print(32, 7, 4, Arg1); 68 | Addressing_Print(32, 0, Instr.Bits.Register, Arg2); 69 | return 0; 70 | } 71 | 72 | int eori_5206_register(void) 73 | { 74 | instruction_register(0x0A80, 0xFFF8, &execute, &disassemble); 75 | return 1; 76 | } 77 | -------------------------------------------------------------------------------- /arch/arm/mach/lh79520.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __LH79520_H__ 3 | #define __LH79520_H__ 4 | 5 | #define TC1OI (1< 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 01/27/2007 initial version by Anthony Lee 23 | */ 24 | 25 | #ifndef __DEV_LCD_S3C44B0X_H_ 26 | #define __DEV_LCD_S3C44B0X_H_ 27 | 28 | #define LCDCON1 (0x0) 29 | #define LCDCON2 (0x4) 30 | #define LCDCON3 (0x40) 31 | #define LCDSADDR1 (0x8) 32 | #define LCDSADDR2 (0xc) 33 | #define LCDSADDR3 (0x10) 34 | 35 | #define REDLUT (0x14) 36 | #define GREENLUT (0x18) 37 | #define BLUELUT (0x1c) 38 | 39 | #define DP1_2 (0x20) 40 | #define DP4_7 (0x24) 41 | #define DP3_5 (0x28) 42 | #define DP2_3 (0x2c) 43 | #define DP5_7 (0x30) 44 | #define DP3_4 (0x34) 45 | #define DP4_5 (0x38) 46 | #define DP6_7 (0x3c) 47 | #define DITHMODE (0x44) 48 | 49 | 50 | typedef struct lcd_s3c44b0x_io 51 | { 52 | u32 lcdcon1; 53 | u32 lcdcon2; 54 | u32 lcdcon3; 55 | u32 lcdsaddr1; 56 | u32 lcdsaddr2; 57 | u32 lcdsaddr3; 58 | 59 | u32 lcdredlut; 60 | u32 lcdgreenlut; 61 | u32 lcdbluelut; 62 | 63 | u32 lcddp12; 64 | u32 lcddp47; 65 | u32 lcddp35; 66 | u32 lcddp23; 67 | u32 lcddp57; 68 | u32 lcddp34; 69 | u32 lcddp45; 70 | u32 lcddp67; 71 | 72 | u32 lcddithmode; 73 | } lcd_s3c44b0x_io_t; 74 | 75 | #endif /* _DEV_LCD_S3C44B0X_H_ */ 76 | 77 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_cmpi.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Compare immediate (CMPI) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | | Upper Word of Immediate Data | 20 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 21 | | Lower Word of Immediate Data | 22 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 23 | 24 | */ 25 | 26 | int CMPITime=1; 27 | 28 | 29 | INSTRUCTION_2ARGS(CMPI, 30 | unsigned Code1,13, 31 | unsigned Register,3); 32 | 33 | static void execute(void) 34 | { 35 | struct _Address Source,Destination; 36 | unsigned int Result, SValue, DValue; 37 | CMPI_Instr Instr; 38 | Memory_RetrWordFromPC(&Instr.Code); 39 | 40 | if(!EA_GetFromPC(&Source, 32, 7, 4)) return; 41 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 42 | 43 | EA_GetValue(&SValue, &Source); 44 | EA_GetValue(&DValue, &Destination); 45 | 46 | Result = DValue - SValue; 47 | 48 | 49 | /* Set the status register */ 50 | SR_Set(I_CMPI, SValue, DValue, Result); 51 | 52 | cycle(CMPITime); 53 | 54 | return; 55 | } 56 | 57 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 58 | { 59 | CMPI_Instr Instr; 60 | Memory_RetrWordFromPC(&Instr.Code); 61 | sprintf(Instruction, "CMPI.L"); 62 | Addressing_Print(32, 7, 4, Arg1); 63 | Addressing_Print(32, 0, Instr.Bits.Register, Arg2); 64 | return 0; 65 | } 66 | 67 | int cmpi_5206_register(void) 68 | { 69 | instruction_register(0x0C80, 0xFFF8, &execute, &disassemble); 70 | return 1; 71 | } 72 | -------------------------------------------------------------------------------- /arch/coldfire/tracer/main.c: -------------------------------------------------------------------------------- 1 | /*************************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see ../LICENSE for more details */ 6 | /* */ 7 | /*************************************/ 8 | 9 | /* THANKS: to the WINE project.. www.winehq.com.. for many ideas on how 10 | * to make this :) */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "tracer.h" 18 | 19 | #define TRACER_DECLARE(ch) {#ch,0}, 20 | 21 | struct _TRACER_Info TRACER_Info[] = { 22 | #include "generated.channels.h" 23 | {NULL,0} 24 | }; 25 | #undef TRACER_DECLARE 26 | 27 | int tracer_indent=0; 28 | int tracer_printf(char *msg, ...) 29 | { 30 | va_list Args; 31 | int x; 32 | 33 | /*f(*msg=='+') 34 | tracer_indent++;*/ 35 | 36 | /*f(*msg!=':') { 37 | printf("%02d:" tracer_indent); 38 | for(x=0;xN = ((int)Result < 0); 56 | SRBits->Z = (Result == 0); 57 | 58 | 59 | cycle(ORITime); 60 | 61 | return; 62 | } 63 | 64 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 65 | { 66 | ORI_Instr Instr; 67 | Memory_RetrWordFromPC(&Instr.Code); 68 | sprintf(Instruction, "ORI.L"); 69 | Addressing_Print(32, 7, 4, Arg1); 70 | Addressing_Print(32, 0, Instr.Bits.Register, Arg2); 71 | return 0; 72 | } 73 | 74 | int ori_5206_register(void) 75 | { 76 | instruction_register(0x0080, 0xFFF8, &execute, &disassemble); 77 | return 1; 78 | } 79 | -------------------------------------------------------------------------------- /device/nandflash/nandflash_largeblock.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | /* 17 | * author bushing 18 | */ 19 | #ifndef _NANDFLASH_LARGEBLOCK_H_ 20 | #define _NANDFLASH_LARGEBLOCK_H_ 21 | #include 22 | #include "skyeye_nandflash.h" 23 | 24 | #ifdef __MINGW32__ 25 | #define FILE_FLAG (O_RDWR | O_CREAT | O_BINARY) 26 | #else 27 | #define FILE_FLAG (O_RDWR | O_CREAT) 28 | #endif 29 | 30 | #if (defined(__MINGW32__) || defined(__BEOS__)) 31 | #define POSIX_SHARE_MEMORY_BROKEN 32 | #endif 33 | 34 | //nandflash cmd status 35 | 36 | typedef enum { 37 | NF_NOSTATUS, 38 | NF_addr_1st, 39 | NF_addr_2nd, 40 | NF_addr_3rd, 41 | NF_addr_4th, 42 | NF_addr_5th, 43 | NF_addr_finish, 44 | NF_status, 45 | NF_readID_1st, 46 | NF_readID_2nd, 47 | NF_readID_3rd, 48 | NF_readID_4th, 49 | NF_readID_addr 50 | } cmdstatustype; 51 | 52 | typedef enum { 53 | NF_CMD, 54 | NF_ADDR, 55 | NF_DATAREAD, 56 | NF_DATAWRITE, 57 | NF_STATUSREAD, 58 | NF_IDREAD, 59 | NF_NONE 60 | } iostatustype; 61 | 62 | struct nandflash_lb_status 63 | { 64 | u8 IOPIN; 65 | u8 status; 66 | NFCE_STATE CLE; 67 | NFCE_STATE ALE; 68 | NFCE_STATE CE; 69 | NFCE_STATE WE; 70 | NFCE_STATE RE; 71 | NFCE_STATE WP; 72 | NFCE_STATE RB; 73 | u8 cmd; 74 | cmdstatustype cmdstatus; 75 | iostatustype iostatus; 76 | int fdump; 77 | u8 *writebuffer; 78 | u32 pagenum; 79 | u16 pageoffset; 80 | u8* addrspace; 81 | u16 pagefmtsize; 82 | }; 83 | 84 | #endif //_NANDFLASH_LARGEBLOCK_H_ 85 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_subi.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Subtract Immediate (SUBI) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | Register | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | | Upper Word of Immediate Data | 20 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 21 | | Lower Word of Immediate Data | 22 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 23 | 24 | */ 25 | 26 | int SUBITime=1; 27 | 28 | 29 | INSTRUCTION_2ARGS(SUBI, 30 | unsigned Code1,13, 31 | unsigned Register,3); 32 | 33 | static void execute(void) 34 | { 35 | struct _Address Source,Destination; 36 | unsigned int Result, SValue, DValue; 37 | SUBI_Instr Instr; 38 | Memory_RetrWordFromPC(&Instr.Code); 39 | 40 | if(!EA_GetFromPC(&Source, 32, 7, 4)) return; 41 | if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Register)) return; 42 | 43 | EA_GetValue(&SValue, &Source); 44 | EA_GetValue(&DValue, &Destination); 45 | 46 | Result = DValue - SValue; 47 | 48 | 49 | /* Set the status register */ 50 | SR_Set(I_SUBI, SValue, DValue, Result); 51 | 52 | EA_PutValue(&Destination, Result); 53 | 54 | 55 | cycle(SUBITime); 56 | 57 | return; 58 | } 59 | 60 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 61 | { 62 | SUBI_Instr Instr; 63 | Memory_RetrWordFromPC(&Instr.Code); 64 | sprintf(Instruction, "SUBI.L"); 65 | Addressing_Print(32, 7, 4, Arg1); 66 | Addressing_Print(32, 0, Instr.Bits.Register, Arg2); 67 | return 0; 68 | } 69 | 70 | int subi_5206_register(void) 71 | { 72 | instruction_register(0x0480, 0xFFF8, &execute, &disassemble); 73 | return 1; 74 | } 75 | -------------------------------------------------------------------------------- /arch/coldfire/common/cycle.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2003, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | /* August 2000: Matt Minnis 10 | * March 2003: David Grant -- Rewrote everything for speed */ 11 | 12 | 13 | #include 14 | 15 | #include "coldfire.h" 16 | 17 | void cycle(unsigned int number) 18 | { 19 | extern struct _board_data board_data; 20 | if(number < 1) return; /* ignore 0 and -1 times since they are invalid */ 21 | board_data.cycle_count += number; 22 | return; 23 | } 24 | 25 | /* Lookup table for getting the right offset in the timing tables 26 | * in each instruction */ 27 | static short cycle_EA_lookup[] = { 0, 0, 1, 2, 3, 4, 5, 6, 6, 4, 5, 7 }; 28 | 29 | int cycle_EA(short reg, short mode) 30 | { 31 | if(mode == 7) return cycle_EA_lookup[reg+7]; 32 | return cycle_EA_lookup[mode]; 33 | } 34 | 35 | #ifdef explanation_of_what_the_above_routine_is_doing 36 | int MoveCycle_EA (int Register, int Mode) (These two are the same) 37 | int Cycle_EA (int Register, int Mode) 38 | { 39 | switch (Mode) /* Return value 0-7 for destination addressing. */ 40 | { 41 | case 0: return sDRD; /* Dy */ 42 | case 1: return sDRD; /* Ay */ 43 | case 2: return sARI; /* (Ay) */ 44 | case 3: return sARIPO; /* (Ay)+ */ 45 | case 4: return sARIPR; /* -(Ay) */ 46 | case 5: return sARID; /* (d16,Ay) */ 47 | case 6: return sARIIB; /* (d8,An,Xi) */ 48 | case 7: switch (Register) 49 | { 50 | case 0: return sAS; /* word addressing */ 51 | case 1: return sAS; /* long addressing */ 52 | case 2: return sARID; /* (d16,PC) */ 53 | case 3: return sARIIB; /* (d8,PC,Xi) */ 54 | case 4: return sIM; /* (d8,PC,Xi) */ 55 | } 56 | break; 57 | 58 | } 59 | /* This can cause a segfault, this returns an offset, returning -1 is bad (DG) */ 60 | return -1; /* Shouldn't get here */ 61 | } 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /device/lcd/dev_lcd_s3c2410.h: -------------------------------------------------------------------------------- 1 | /* 2 | dev_lcd_s3c2410.h - skyeye S3C2410 lcd controllor simulation 3 | Copyright (C) 2003 - 2005 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 07/25/2005 initial version 23 | * walimis 24 | * */ 25 | #ifndef __DEV_LCD_S3C2410_H_ 26 | #define __DEV_LCD_S3C2410_H_ 27 | 28 | 29 | #define VBUFSIZ 0x00001fff /* Video buffer size (bits/128-1) */ 30 | #define LINELEN 0x0007e000 /* Line length (pix/16-1) */ 31 | #define LINELEN_SHIFT 13 32 | #define PIXPSC 0x01f80000 /* Pixel prescale (526628/pixels-1) */ 33 | #define PIXPSC_SHIFT 19 34 | #define ACPSC 0x3e000000 /* AC prescale */ 35 | #define ACPSC_SHIFT 25 36 | #define GSEN 0x40000000 /* Grayscale enable (0: monochrome) */ 37 | #define GSMD 0x80000000 /* Grayscale mode (0: 2 bit, 1: 4 bit) */ 38 | 39 | 40 | #define LCDCON1 (0x0) 41 | #define LCDCON2 (0x4 * 1) 42 | #define LCDCON3 (0x4 * 2) 43 | #define LCDCON4 (0x4 * 3) 44 | #define LCDCON5 (0x4 * 4) 45 | #define LCDSADDR1 (0x4 * 5) 46 | #define LCDSADDR2 (0x4 * 6) 47 | #define LCDSADDR3 (0x4 * 7) 48 | 49 | typedef struct lcd_s3c2410_io 50 | { 51 | u32 lcdcon1; 52 | u32 lcdcon2; 53 | u32 lcdcon3; 54 | u32 lcdcon4; 55 | u32 lcdcon5; 56 | u32 lcdsaddr1; 57 | u32 lcdsaddr2; 58 | u32 lcdsaddr3; 59 | u32 lcdintpnd; 60 | u32 lcdsrcpnd; 61 | u32 lcdintmsk; 62 | } lcd_s3c2410_io_t; 63 | 64 | 65 | #endif //_DEV_LCD_S3C2410_H_ 66 | -------------------------------------------------------------------------------- /arch/arm/dbct/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | #ifndef _LIST_H_ 17 | #define _LIST_H_ 18 | 19 | struct list_head 20 | { 21 | struct list_head *next, *prev; 22 | }; 23 | 24 | #define LIST_HEAD_INIT(name) { &(name), &(name) } 25 | 26 | #define LIST_HEAD(name) \ 27 | struct list_head name = LIST_HEAD_INIT(name) 28 | 29 | #define INIT_LIST_HEAD(ptr) do { \ 30 | (ptr)->next = (ptr); (ptr)->prev = (ptr); \ 31 | } while (0) 32 | 33 | #define list_for_each_safe(pos, n, head) \ 34 | for (pos = (head)->next, n = pos->next; pos != (head); \ 35 | pos = n, n = pos->next) 36 | 37 | #define list_entry(ptr, type, member) \ 38 | ((type *)((char *)(ptr)-(unsigned int)(&((type *)0)->member))) 39 | 40 | static __inline__ void 41 | __list_add (struct list_head *new, 42 | struct list_head *prev, struct list_head *next) 43 | { 44 | next->prev = new; 45 | new->next = next; 46 | new->prev = prev; 47 | prev->next = new; 48 | } 49 | 50 | static __inline__ void 51 | list_add_tail (struct list_head *new, struct list_head *head) 52 | { 53 | __list_add (new, head->prev, head); 54 | } 55 | 56 | static __inline__ void 57 | __list_del (struct list_head *prev, struct list_head *next) 58 | { 59 | next->prev = prev; 60 | prev->next = next; 61 | } 62 | 63 | static __inline__ void 64 | list_del_init (struct list_head *entry) 65 | { 66 | __list_del (entry->prev, entry->next); 67 | INIT_LIST_HEAD (entry); 68 | } 69 | 70 | static __inline__ int 71 | list_empty (struct list_head *head) 72 | { 73 | return head->next == head; 74 | } 75 | 76 | #endif //_LIST_H_ 77 | -------------------------------------------------------------------------------- /arch/coldfire/i_5206/i_clr.c: -------------------------------------------------------------------------------- 1 | /**********************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see LICENSE for more details */ 6 | /* */ 7 | /**********************************/ 8 | 9 | #include "coldfire.h" 10 | 11 | /* Clear (CLR) instruction */ 12 | 13 | /* Format 14 | 15 | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 17 | | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | Size | EAMode |EARegister | 18 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 19 | 20 | */ 21 | 22 | int CLRTime[8]={ 1, 1, 1, 1, 1, 2, 1, -1}; 23 | 24 | 25 | INSTRUCTION_4ARGS(CLR, 26 | unsigned Code1,8, 27 | unsigned Size,2, 28 | unsigned EAMode,3, 29 | unsigned EARegister,3); 30 | 31 | const short CLR_SizeBits[4]={ 8 , 16 , 32 , 0 }; 32 | const char CLR_SizeStr[4]= {'B', 'W', 'L', '?'}; 33 | 34 | static void execute(void) 35 | { 36 | struct _Address Destination; 37 | CLR_Instr Instr; 38 | 39 | Memory_RetrWordFromPC(&Instr.Code); 40 | 41 | 42 | if(Instr.Bits.Size == 3) { 43 | ERR("Invalid size=3", memory_core.pc); 44 | return; 45 | } 46 | 47 | if(!EA_GetFromPC(&Destination, CLR_SizeBits[(short)Instr.Bits.Size], Instr.Bits.EAMode, Instr.Bits.EARegister)) return; 48 | EA_PutValue(&Destination, 0); 49 | 50 | /* X - Not affected 51 | N - Always Cleared 52 | Z - Always Set 53 | V - Always Cleared 54 | C - Always Cleared 55 | */ 56 | SRBits->N=0; 57 | SRBits->Z=1; 58 | SRBits->V=0; 59 | SRBits->C=0; 60 | cycle(CLRTime[cycle_EA(Instr.Bits.EARegister,Instr.Bits.EAMode)]); 61 | return; 62 | } 63 | 64 | static int disassemble(char *Instruction, char *Arg1, char *Arg2) 65 | { 66 | CLR_Instr Instr; 67 | Memory_RetrWordFromPC(&Instr.Code); 68 | 69 | sprintf(Instruction, "CLR.%c", CLR_SizeStr[(short)Instr.Bits.Size]); 70 | 71 | Addressing_Print(CLR_SizeBits[(short)Instr.Bits.Size], Instr.Bits.EAMode, Instr.Bits.EARegister, Arg1); 72 | Arg2[0]=0; 73 | 74 | return 0; 75 | } 76 | 77 | int clr_5206_register(void) 78 | { 79 | instruction_register(0x4200, 0xFF00, &execute, &disassemble); 80 | return 1; 81 | } 82 | -------------------------------------------------------------------------------- /utils/config/skyeye_options.h: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_option.h - definitions of the device options structures. 3 | Copyright (C) 2004 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | */ 21 | /* 22 | * 05/16/2004 initial version 23 | * 24 | * walimis 25 | * */ 26 | 27 | #ifndef __SKYEYE_OPTION_H_ 28 | #define __SKYEYE_OPTION_H_ 29 | 30 | #include "skyeye.h" 31 | #include "skyeye_device.h" 32 | #include "skyeye_config.h" 33 | 34 | struct uart_option 35 | { 36 | /* 2007-01-18 by Anthony Lee: for new uart device frame */ 37 | char desc_in[MAX_STR_NAME]; /* description of device, such as path etc. */ 38 | char desc_out[MAX_STR_NAME]; /* description of device, such as path etc. */ 39 | int mod; 40 | 41 | char converter[MAX_STR_NAME]; 42 | }; 43 | 44 | 45 | struct timer_option 46 | { 47 | }; 48 | 49 | 50 | struct net_option 51 | { 52 | unsigned char macaddr[6]; 53 | unsigned char hostip[4]; 54 | int ethmod; 55 | }; 56 | 57 | 58 | struct lcd_option 59 | { 60 | /* display mode. e.g. gtk, qt, X, sdl */ 61 | int mod; 62 | 63 | int width; 64 | int height; 65 | 66 | int depth; 67 | }; 68 | 69 | 70 | struct flash_option 71 | { 72 | char dump[MAX_STR_NAME]; 73 | int dumptype; 74 | }; 75 | 76 | 77 | struct touchscreen_option 78 | { 79 | }; 80 | 81 | 82 | struct sound_option 83 | { 84 | int mod; 85 | 86 | int channels; 87 | int bits_per_sample; 88 | int samples_per_sec; 89 | }; 90 | 91 | int skyeye_option_init (skyeye_config_t *config); 92 | 93 | #endif /*__SKYEYE_OPTION_H_ */ 94 | 95 | -------------------------------------------------------------------------------- /device/sound/skyeye_sound.h: -------------------------------------------------------------------------------- 1 | /* 2 | skyeye_sound.h - skyeye sound device support functions 3 | Copyright (C) 2003 - 2007 Skyeye Develop Group 4 | for help please send mail to 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /* 22 | * 03/25/2007 initial version by Anthony Lee 23 | */ 24 | 25 | #ifndef __SKYEYE_SOUND_H_ 26 | #define __SKYEYE_SOUND_H_ 27 | 28 | #include "skyeye_device.h" 29 | 30 | /* sound simulation type */ 31 | #define SOUND_SIM_PCM 1 /* pcm data write to device directly */ 32 | 33 | struct sound_device 34 | { 35 | int mod; 36 | 37 | int channels; 38 | int bits_per_sample; 39 | int samples_per_sec; 40 | 41 | /* private data. */ 42 | void *priv; 43 | 44 | int (*sound_open)(struct sound_device *snd_dev); 45 | int (*sound_close)(struct sound_device *snd_dev); 46 | int (*sound_update)(struct sound_device *snd_dev); 47 | int (*sound_read)(struct sound_device *snd_dev, void *buf, size_t count); 48 | int (*sound_write)(struct sound_device *snd_dev, void *buf, size_t count); 49 | }; 50 | 51 | 52 | /* sound controller initialize functions */ 53 | extern void sound_s3c44b0x_init(struct device_module_set *mod_set); 54 | 55 | 56 | /* modules */ 57 | int pcm_sound_open(struct sound_device *snd_dev); 58 | int pcm_sound_close(struct sound_device *snd_dev); 59 | int pcm_sound_update(struct sound_device *snd_dev); 60 | int pcm_sound_read(struct sound_device *snd_dev, void *buf, size_t count); 61 | int pcm_sound_write(struct sound_device *snd_dev, void *buf, size_t count); 62 | 63 | 64 | /* help function*/ 65 | 66 | #endif /* __SKYEYE_SOUND_H_ */ 67 | 68 | -------------------------------------------------------------------------------- /arch/ppc/common/ppc_opc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PearPC 3 | * ppc_opc.h 4 | * 5 | * Copyright (C) 2003 Sebastian Biallas (sb@biallas.net) 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License version 2 as 9 | * published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #ifndef __PPC_OPC_H__ 22 | #define __PPC_OPC_H__ 23 | 24 | #include "types.h" 25 | 26 | static inline void ppc_update_cr0(uint32 r) 27 | { 28 | gCPU.cr &= 0x0fffffff; 29 | if (!r) { 30 | gCPU.cr |= CR_CR0_EQ; 31 | } else if (r & 0x80000000) { 32 | gCPU.cr |= CR_CR0_LT; 33 | } else { 34 | gCPU.cr |= CR_CR0_GT; 35 | } 36 | if (gCPU.xer & XER_SO) gCPU.cr |= CR_CR0_SO; 37 | } 38 | 39 | void ppc_opc_bx(); 40 | void ppc_opc_bcx(); 41 | void ppc_opc_bcctrx(); 42 | void ppc_opc_bclrx(); 43 | 44 | void ppc_opc_dcba(); 45 | void ppc_opc_dcbf(); 46 | void ppc_opc_dcbi(); 47 | void ppc_opc_dcbst(); 48 | void ppc_opc_dcbt(); 49 | void ppc_opc_dcbtst(); 50 | 51 | void ppc_opc_eciwx(); 52 | void ppc_opc_ecowx(); 53 | void ppc_opc_eieio(); 54 | 55 | void ppc_opc_icbi(); 56 | void ppc_opc_isync(); 57 | 58 | void ppc_opc_mcrf(); 59 | void ppc_opc_mcrfs(); 60 | void ppc_opc_mcrxr(); 61 | void ppc_opc_mfcr(); 62 | void ppc_opc_mffsx(); 63 | void ppc_opc_mfmsr(); 64 | void ppc_opc_mfspr(); 65 | void ppc_opc_mfsr(); 66 | void ppc_opc_mfsrin(); 67 | void ppc_opc_mftb(); 68 | void ppc_opc_mtcrf(); 69 | void ppc_opc_mtfsb0x(); 70 | void ppc_opc_mtfsb1x(); 71 | void ppc_opc_mtfsfx(); 72 | void ppc_opc_mtfsfix(); 73 | void ppc_opc_mtmsr(); 74 | void ppc_opc_mtspr(); 75 | void ppc_opc_mtsr(); 76 | void ppc_opc_mtsrin(); 77 | 78 | void ppc_opc_rfi(); 79 | void ppc_opc_sc(); 80 | void ppc_opc_sync(); 81 | void ppc_opc_tlbia(); 82 | void ppc_opc_tlbie(); 83 | void ppc_opc_tlbsync(); 84 | void ppc_opc_tw(); 85 | void ppc_opc_twi(); 86 | 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /device/nandflash/nandflash_smallblock.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2, or (at your option) 5 | any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along 13 | with this program; if not, write to the Free Software Foundation, Inc., 14 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 15 | 16 | /* 17 | * author gbf0871 18 | */ 19 | #ifndef _NANDFLASH_SMALLBLOCK_H_ 20 | #define _NANDFLASH_SMALLBLOCK_H_ 21 | #include 22 | #include "skyeye_nandflash.h" 23 | 24 | #ifdef __MINGW32__ 25 | #define FILE_FLAG (O_RDWR | O_CREAT | O_BINARY) 26 | #else 27 | #define FILE_FLAG (O_RDWR | O_CREAT) 28 | #endif 29 | 30 | #if (defined(__MINGW32__) || defined(__BEOS__)) 31 | #define POSIX_SHARE_MEMORY_BROKEN 32 | #endif 33 | 34 | //nandflash cmd status 35 | 36 | typedef enum { 37 | NF_NOSTATUS, 38 | NF_addr_1st, 39 | NF_addr_2nd, 40 | NF_addr_3rd, 41 | NF_addr_4th, 42 | NF_addr_finish, 43 | NF_status, 44 | NF_readID_1st, 45 | NF_readID_2nd, 46 | NF_readID_3rd, 47 | NF_readID_4th, 48 | NF_readID_addr 49 | } cmdstatustype; 50 | 51 | typedef enum { 52 | NF_CMD, 53 | NF_ADDR, 54 | NF_DATAREAD, 55 | NF_DATAWRITE, 56 | NF_STATUSREAD, 57 | NF_IDREAD, 58 | NF_NONE 59 | } iostatustype; 60 | struct nandflash_sb_status 61 | { 62 | u8 IOPIN; 63 | u8 status; 64 | NFCE_STATE CLE; 65 | NFCE_STATE ALE; 66 | NFCE_STATE CE; 67 | NFCE_STATE WE; 68 | NFCE_STATE RE; 69 | NFCE_STATE WP; 70 | NFCE_STATE RB; 71 | u8 cmd; 72 | cmdstatustype cmdstatus; 73 | iostatustype iostatus; 74 | u32 address; 75 | //u32 memsize; 76 | int fdump; 77 | u8 *writebuffer; 78 | u16 pageoffset; 79 | #ifdef POSIX_SHARE_MEMORY_BROKEN 80 | u8 *readbuffer; 81 | u32 curblock; 82 | FILE *fd; 83 | #else 84 | u8* addrspace; 85 | #endif 86 | }; 87 | 88 | #endif //_NANDFLASH_SMALLBLOCK_H_ 89 | -------------------------------------------------------------------------------- /device/nandflash/tools/mknandflashdump.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) 10 | int main(int argc, char *argv[]) 11 | { 12 | int fdin, fdout; 13 | unsigned char *src, *dst; 14 | struct stat statbuf; 15 | int i,j,size,offset,pos; 16 | if (argc != 4) 17 | { 18 | printf("usage: %s \n", argv[0]); 19 | exit(1); 20 | } 21 | 22 | if ((fdin = open(argv[1], O_RDONLY)) < 0) 23 | { 24 | printf("can't open %s for reading", argv[1]); 25 | exit(1); 26 | } 27 | 28 | if ((fdout = open(argv[2], O_RDWR | O_CREAT, 29 | FILE_MODE)) < 0) 30 | { 31 | printf("can't creat %s for writing", argv[2]); 32 | exit(1); 33 | } 34 | 35 | if (fstat(fdin, &statbuf) < 0) /* need size of input file */ 36 | { 37 | printf("fstat error"); 38 | exit(1); 39 | } 40 | offset=strtoul(argv[3],NULL,0); 41 | if(offset %512) 42 | { 43 | printf("offset not a multiple of 512 bytes\n"); 44 | exit(1); 45 | } 46 | size=((statbuf.st_size+offset+511)/512)*528; 47 | /* set size of output file */ 48 | if (lseek(fdout, size - 1, SEEK_SET) == -1) 49 | { 50 | printf("lseek error"); 51 | exit(1); 52 | } 53 | if (write(fdout, "", 1) != 1) 54 | { 55 | printf("write error"); 56 | exit(1); 57 | } 58 | if ((src = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, 59 | fdin, 0)) == MAP_FAILED) 60 | { 61 | printf("mmap error for input"); 62 | exit(1); 63 | } 64 | 65 | if ((dst = mmap(0, size, PROT_READ | PROT_WRITE, 66 | MAP_SHARED, fdout, 0)) == MAP_FAILED) 67 | { 68 | printf("mmap error for output"); 69 | exit(1); 70 | } 71 | //memset(dst+offset,0xFF,size-offset); 72 | //printf("%x\n",offset); 73 | for(i=0,pos=(offset*528/512);i 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | /* 21 | * 04/12/2007 Written by Anthony Lee 22 | */ 23 | 24 | #include 25 | #include "portable/mman.h" 26 | 27 | 28 | int getpagesize(void) 29 | { 30 | return 1024; 31 | } 32 | 33 | 34 | void* mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) 35 | { 36 | HANDLE handle, file; 37 | DWORD nRead = 0; 38 | void *retVal = NULL; 39 | 40 | if ((flags & (MAP_FIXED | MAP_SHARED)) || 41 | ((prot & PROT_WRITE) && fd != -1) || 42 | !(fd == -1 || (file = (HANDLE)_get_osfhandle(fd)) != INVALID_HANDLE_VALUE) || 43 | length == 0) return MAP_FAILED; 44 | 45 | if ((handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, 46 | PAGE_READWRITE, 47 | 0, (DWORD)length, 48 | NULL)) == NULL) return MAP_FAILED; 49 | 50 | if ((retVal = MapViewOfFile(handle, FILE_MAP_ALL_ACCESS, 0, 0, 0)) == NULL) goto exit; 51 | 52 | if (fd != -1) { 53 | if (SetFilePointer(file, (DWORD)offset, 54 | NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) goto err; 55 | if (ReadFile(file, retVal, (DWORD)length, &nRead, NULL) == 0) goto err; 56 | } 57 | 58 | goto exit; 59 | 60 | err: 61 | UnmapViewOfFile(retVal); 62 | retVal = NULL; 63 | 64 | exit: 65 | CloseHandle(handle); 66 | return (retVal == NULL ? MAP_FAILED : retVal); 67 | } 68 | 69 | 70 | int munmap(void *addr, size_t length) 71 | { 72 | if (addr == NULL || addr == MAP_FAILED) return -1; 73 | 74 | return (UnmapViewOfFile(addr) == 0 ? -1 : 0); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /arch/coldfire/tracer/tracer.h: -------------------------------------------------------------------------------- 1 | /*************************************/ 2 | /* */ 3 | /* Copyright 2000, David Grant */ 4 | /* */ 5 | /* see ../LICENSE for more details */ 6 | /* */ 7 | /*************************************/ 8 | #ifndef TRACER_H 9 | #define TRACER_H 10 | /* THANKS: to the WINE project.. www.winehq.com.. for many ideas on how 11 | * to make this :) */ 12 | 13 | /* If you define TRACER_OFF in your code, it will compile out all the tracer 14 | * stuff for that source file */ 15 | #ifdef TRACER_OFF 16 | #undef TRACER_ENABLE 17 | #else 18 | #define TRACER_ENABLE 19 | #endif 20 | 21 | struct _TRACER_Info { 22 | char *Name; 23 | char Enabled; 24 | }; 25 | 26 | extern struct _TRACER_Info TRACER_Info[]; 27 | 28 | int tracer_printf(char *msg, ...); 29 | int tracer_setuptrace(char *str); 30 | 31 | #define TRACER_DECLARE(ch) TRACER_##ch, 32 | enum _TRACER_Channels { 33 | #include "generated.channels.h" 34 | TRACER_Last 35 | }; 36 | #undef TRACER_DECLARE 37 | 38 | 39 | #define __TPRINTF_DUMMY(x...) 40 | 41 | #define __TPRINTF(chnumber) if(TRACER_Info[chnumber].Enabled) \ 42 | tracer_printf("%s:%s(): ",TRACER_Info[chnumber].Name, \ 43 | __FUNCTION__),\ 44 | tracer_printf 45 | 46 | #ifdef TRACER_ENABLE 47 | #define TRACER_DEFAULT_CHANNEL(ch) static const enum _TRACER_Channels TRACER_default = TRACER_##ch 48 | #define TRACE __TPRINTF(TRACER_default) 49 | #define TRACE_(ch) __TPRINTF(TRACER_##ch) 50 | 51 | /* 52 | #define ERR tracer_printf("%s:%s(): ",TRACER_Info[TRACER_default].Name,__FUNCTION__);\ 53 | tracer_printf 54 | */ 55 | 56 | #define ERR tracer_printf("%s:%s(): ",__FILE__,__FUNCTION__);\ 57 | tracer_printf 58 | 59 | 60 | #define ERR_(ch) tracer_printf("%s:%s(): ",TRACER_Info[TRACER_##ch].Name,__FUNCTION__);\ 61 | tracer_printf 62 | #define IFTRACE (TRACER_Info[TRACER_default].Enabled) 63 | #define IFTRACE_(ch) (TRACER_Info[ch].Enabled) 64 | #else 65 | #define TRACER_DEFAULT_CHANNEL(ch) 66 | 67 | #define TRACE __TPRINTF_DUMMY 68 | #define TRACE_(ch) __TPRINTF_DUMMY 69 | 70 | #define ERR __TPRINTF_DUMMY 71 | #define ERR_(ch) __TPRINTF_DUMMY 72 | 73 | #define IFTRACE 0 74 | #define IFTRACE_(ch) 0 75 | 76 | #endif 77 | #endif 78 | --------------------------------------------------------------------------------