Exemple #1
0
void FIN_BLOCK()
{
   if (!delay_slot)
     {
	jump_to((PC-1)->addr+4);
	PC->ops();
	if (dynacore) dyna_jump();
     }
   else
     {
#ifdef PPC_DYNAREC
	PowerPC_block* blk = actual;
#else
	precomp_block *blk = actual;
#endif
	precomp_instr *inst = PC;
	jump_to((PC-1)->addr+4);

	if (!skip_jump)
	  {
	     PC->ops();
	     actual = blk;
	     PC = inst+1;
	  }
	else
	  PC->ops();

	if (dynacore) dyna_jump();
     }
}
Exemple #2
0
void FIN_BLOCK()
{
   if (!delay_slot)
     {
	jump_to((PC-1)->addr+4);
	PC->ops();
	if (dynacore) dyna_jump();
     }
   else
     {
	precomp_block *blk = actual;
	precomp_instr *inst = PC;
	jump_to((PC-1)->addr+4);
	
	if (!skip_jump)
	  {
	     PC->ops();
	     actual = blk;
	     PC = inst+1;
	  }
	else
	  PC->ops();
	
	if (dynacore) dyna_jump();
     }
}
        int coroutine_context_base::yield() {
            if (NULL == callee_) return COPP_EC_NOT_INITED;

#ifdef COPP_MACRO_USE_SEGMENTED_STACKS
            jump_to(callee_, caller_, callee_stack_, caller_stack_,
                (intptr_t) this, preserve_fpu_);
#else
            jump_to(callee_, caller_, callee_stack_, callee_stack_, (intptr_t) this, preserve_fpu_);
#endif

            return COPP_EC_SUCCESS;
        }
void generic_jump_to(unsigned int address)
{
   if (r4300emu == CORE_PURE_INTERPRETER)
      PC->addr = address;
   else {
#ifdef NEW_DYNAREC
      if (r4300emu == CORE_DYNAREC)
         last_addr = pcaddr;
      else
         jump_to(address);
#else
      jump_to(address);
#endif
   }
}
Exemple #5
0
YFileList::~YFileList( )
{
    YEditFile **File;

    jump_to( 0 );
    while( ( File = next( ) ) != NULL ) delete *File;
}
void ShellBrowser::Init()
{
    CONTEXT("ShellBrowser::Init()");

    const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR);

    _root._drive_type = DRIVE_UNKNOWN;
    lstrcpy(_root._volname, root_name);
    _root._fs_flags = 0;
    lstrcpy(_root._fs, TEXT("Desktop"));

    _root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd);

    _root._entry->read_directory(SCAN_DONT_ACCESS|SCAN_NO_FILESYSTEM);	// avoid to handle desktop root folder as file system directory

    if (_left_hwnd) {
        InitializeTree();
        InitDragDrop();
    }

    jump_to(_create_info._shell_path);

    /* already filled by ShellDirectory constructor
    lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */
}
Exemple #7
0
std::vector<topic> generate_time_of_day_topics(const bool /*sort_generated*/)
{
	std::vector<topic> topics;
	std::stringstream toplevel;

	if (! resources::tod_manager) {
		toplevel << N_("Only available during a scenario.");
		topics.push_back( topic("Time of Day Schedule", "..schedule", toplevel.str()) );
		return topics;
	}
	const std::vector<time_of_day>& times = resources::tod_manager->times();
	BOOST_FOREACH(const time_of_day& time, times)
	{
		const std::string id = "time_of_day_" + time.id;
		const std::string image = "<img>src='" + time.image + "'</img>";
		std::stringstream text;

		toplevel << make_link(time.name.str(), id) << jump_to(160) <<
				image << jump(30) << time.lawful_bonus << '\n';

		text << image << '\n' <<
				time.description.str() << '\n' <<
				"Lawful Bonus: " << time.lawful_bonus << '\n' <<
				'\n' << make_link(N_("Schedule"), "..schedule");

		topics.push_back( topic(time.name.str(), id, text.str()) );
	}

	topics.push_back( topic("Time of Day Schedule", "..schedule", toplevel.str()) );
	return topics;
}
/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
int sunxi_board_run_fel(void)
{
#if defined(CONFIG_SUN6I) || defined(CONFIG_ARCH_SUN8IW3P1)|| defined(CONFIG_ARCH_SUN8IW5P1) || defined(CONFIG_ARCH_SUN7I)|| defined(CONFIG_ARCH_SUN8IW8P1)
	*((volatile unsigned int *)(SUNXI_RUN_EFEX_ADDR)) = SUNXI_RUN_EFEX_FLAG;
#elif defined(CONFIG_ARCH_SUN9IW1P1) || defined(CONFIG_ARCH_SUN8IW7P1) || defined(CONFIG_ARCH_SUN8IW6P1)
	sunxi_set_fel_flag();
#endif
	printf("set next system status\n");

	axp_set_next_poweron_status(PMU_PRE_SYS_MODE);

	board_display_set_exit_mode(0);
#ifdef CONFIG_SUNXI_DISPLAY
	drv_disp_exit();
#endif
	printf("sunxi_board_close_source\n");
	sunxi_board_close_source();

	sunxi_flush_allcaches();
#if defined(CONFIG_ARCH_SUN5I)
	printf("jump to fel_base\n");
	jump_to(FEL_BASE);
#else
	printf("reset cpu\n");

	reset_cpu(0);
#endif

	return 0;
}
Exemple #9
0
void BGEZALL_OUT(void)
{
   local_rs = irs;
   reg[31]=PC->addr+8;
   if((&irs)!=(reg+31))
     {
    if (local_rs >= 0)
      {
         jump_target = (int)PC->f.i.immediate;
         PC++;
         delay_slot=1;
#ifdef DBG
            if (g_DebuggerActive) update_debugger(PC->addr);
#endif
         PC->ops();
         update_count();
         delay_slot=0;
         if (!skip_jump)
           jump_to(PC->addr + ((jump_target-1)<<2));
      }
    else
      PC+=2;
     }
   else DebugMessage(M64MSG_ERROR, "error in BGEZALL_OUT");
   last_addr = PC->addr;
   if (next_interupt <= Count) gen_interupt();
}
LRESULT ShellBrowserChild::Init()
{
	CONTEXT("ShellBrowserChild::Init()");

	ClientRect rect(_hwnd);

	const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR);

	_root._drive_type = DRIVE_UNKNOWN;
	lstrcpy(_root._volname, root_name);
	_root._fs_flags = 0;
	lstrcpy(_root._fs, TEXT("Desktop"));

	_root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd);

	 // -> set_curdir()
	_root._entry->read_directory();

	if (_left_hwnd) {
		InitializeTree();
		InitDragDrop();
	}

	jump_to(_create_info._shell_path);

	return 0;
}
/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
int sunxi_board_run_fel_eraly(void)
{
#if defined(CONFIG_SUN6I) || defined(CONFIG_ARCH_SUN8IW3P1) || defined(CONFIG_ARCH_SUN8IW5P1)|| defined(CONFIG_ARCH_SUN7I)||defined(CONFIG_ARCH_SUN8IW8P1)
	*((volatile unsigned int *)(SUNXI_RUN_EFEX_ADDR)) = SUNXI_RUN_EFEX_FLAG;
#elif defined(CONFIG_ARCH_SUN9IW1P1) || defined(CONFIG_ARCH_SUN8IW7P1) || defined(CONFIG_ARCH_SUN8IW6P1)
	sunxi_set_fel_flag();
#endif
	printf("set next system status\n");
    axp_set_next_poweron_status(PMU_PRE_SYS_MODE);
	timer_exit();
	sunxi_key_exit();
#ifdef CONFIG_SUN6I
	p2wi_exit();
#endif
	sunxi_dma_exit();
#if defined(CONFIG_ARCH_SUN5I)
	printf("jump to fel_base\n");
	jump_to(FEL_BASE);
#else
	printf("reset cpu\n");
//#if defined(CONFIG_ARCH_SUN9IW1P1)
//	*( volatile unsigned int *)(0x008000e0) = 0x16aa0000;
//#endif
	reset_cpu(0);
#endif
	return 0;
}
Exemple #12
0
void BGEZALL_OUT(void)
{
    local_rs = irs;
    reg[31]=PC->addr+8;
    if((&irs)!=(reg+31))
    {
        if (local_rs >= 0)
        {
            jump_target = (int)PC->f.i.immediate;
            PC++;
            delay_slot=1;
#ifdef DBG
            if (debugger_mode) update_debugger(PC->addr);
#endif
            PC->ops();
            update_count();
            delay_slot=0;
            if (!skip_jump)
                jump_to(PC->addr + ((jump_target-1)<<2));
        }
        else
            PC+=2;
    }
    else printf("erreur dans bgezall\n");
    last_addr = PC->addr;
    if (next_interupt <= Count) gen_interupt();
}
Exemple #13
0
OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
  // make a frame and preserve the caller's caller-save registers
  OopMap* oop_map = save_live_registers(sasm);

  // call the runtime patching routine, returns non-zero if nmethod got deopted.
  int call_offset = __ call_RT(noreg, noreg, target);
  OopMapSet* oop_maps = new OopMapSet();
  oop_maps->add_gc_map(call_offset, oop_map);

  // re-execute the patched instruction or, if the nmethod was deoptmized, return to the
  // deoptimization handler entry that will cause re-execution of the current bytecode
  DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob();
  assert(deopt_blob != NULL, "deoptimization blob must have been created");

  Label no_deopt;
  __ br_null_short(O0, Assembler::pt, no_deopt);

  // return to the deoptimization handler entry for unpacking and rexecute
  // if we simply returned the we'd deopt as if any call we patched had just
  // returned.

  restore_live_registers(sasm);

  AddressLiteral dest(deopt_blob->unpack_with_reexecution());
  __ jump_to(dest, O0);
  __ delayed()->restore();

  __ bind(no_deopt);
  restore_live_registers(sasm);
  __ ret();
  __ delayed()->restore();

  return oop_maps;
}
int ShellBrowserChild::Command(int id, int code)
{
	switch(id) {
	  case ID_BROWSE_BACK:
		break;//@todo

	  case ID_BROWSE_FORWARD:
		break;//@todo

	  case ID_BROWSE_UP:
		if (_left_hwnd) {
			//@@ not necessary in this simply case: jump_to(_cur_dir->_up);

			 //@@ -> move into jump_to()
			HTREEITEM hitem = TreeView_GetParent(_left_hwnd, _last_sel);

			if (hitem)
				TreeView_SelectItem(_left_hwnd, hitem);	// sends TVN_SELCHANGED notification
		} else {
			if (_cur_dir->_up)
				jump_to(_cur_dir->_up);
		}
		break;

	  default:
		return 1;
	}

	return 0;
}
Exemple #15
0
void
Entity::ScriptJumpToPosition( const float x, const float y, const float z, const float seconds )
{
    Ogre::Vector3 jump_to( x, y, z );
    SetJump( jump_to, seconds );

    LOG_TRIVIAL( "[SCRIPT] Entity \"" + m_Name + "\" set jump to position \"" + Ogre::StringConverter::toString( jump_to ) + "\" in " + Ogre::StringConverter::toString( seconds ) + " seconds." );
}
void StaticCallStub::emit_code(LIR_Assembler* ce) {
  __ relocate(static_stub_Relocation::spec(_call_pc));
  __ set_oop(NULL, G5);
  // must be set to -1 at code generation time
  Address a(G3, (address)-1);
  __ jump_to(a, 0);
  __ delayed()->nop();
}
Exemple #17
0
int cmd_jump(int argc, CmdArg* argv) {
    int i = 0;
    void* address = NULL;
    if(argc < 2) {
        puts("usage: jump <address>\n");
        return 0;
    }
    if(argc == 2) {
        address = (void*) argv[1].uinteger;
        jump_to(0, address, 0);
    }
    if(argc == 4) {
        address = (void*) argv[1].uinteger;
        jump_to(argv[2].uinteger, argv[2].uinteger, argv[2].uinteger);
    }

    return 0;
}
void ShellBrowserChild::OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv)
{
	CONTEXT("ShellBrowserChild::OnTreeItemSelected()");

	ShellDirectory* dir = (ShellDirectory*)pnmtv->itemNew.lParam;

	jump_to(dir);

	_last_sel = pnmtv->itemNew.hItem;
}
static void dynarec_setup_code(void)
{
   // The dynarec jumps here after we call dyna_start and it prepares
   // Here we need to prepare the initial code block and jump to it
   jump_to(0xa4000040);

   // Prevent segfault on failed jump_to
   if (!actual->block || !actual->code)
      dyna_stop();
}
        int coroutine_context_base::start() {
            if (NULL == callee_) return COPP_EC_NOT_INITED;

            // record this coroutine
            coroutine_context_base* father_coroutine = gt_current_coroutine;
            gt_current_coroutine = this;

#ifdef COPP_MACRO_USE_SEGMENTED_STACKS
            jump_to(caller_, callee_, caller_stack_, callee_stack_,
                (intptr_t) this, preserve_fpu_);
#else
            jump_to(caller_, callee_, callee_stack_, callee_stack_, (intptr_t) this, preserve_fpu_);
#endif

            // restore this coroutine
            gt_current_coroutine = father_coroutine;

            return COPP_EC_SUCCESS;
        }
Exemple #21
0
/*!
 * This function clears the list without destroying it. The EditBuffers pointed at by the list
 * elements are removed.
 */
void EditList::clear( )
{
    EditBuffer *p;

    jump_to( 0 );
    while ( (p = next( ) ) != NULL ) {
        delete p;
    }
    List< EditBuffer * >::clear( );
}
void r4300_init(void)
{
    current_instruction_table = cached_interpreter_table;

    delay_slot=0;
    stop = 0;
    rompause = 0;

    /* clear instruction counters */
#if defined(COUNT_INSTR)
    memset(instr_count, 0, 131 * sizeof(instr_count[0]));
#endif

    last_addr = 0xa4000040;
    next_interupt = 624999;
    init_interupt();

    if (r4300emu == CORE_PURE_INTERPRETER)
    {
        DebugMessage(M64MSG_INFO, "Starting R4300 emulator: Pure Interpreter");
        r4300emu = CORE_PURE_INTERPRETER;
        pure_interpreter_init();
    }
#if defined(DYNAREC)
    else if (r4300emu >= 2)
    {
        DebugMessage(M64MSG_INFO, "Starting R4300 emulator: Dynamic Recompiler");

        {
           r4300emu = CORE_DYNAREC;
           init_blocks();

#ifdef NEW_DYNAREC
           new_dynarec_init();
#elif !defined(NO_ASM) && defined(DYNAREC)
           dyna_start(dynarec_setup_code);
#endif
        }
    }
#endif
    else /* if (r4300emu == CORE_INTERPRETER) */
    {
        DebugMessage(M64MSG_INFO, "Starting R4300 emulator: Cached Interpreter");
        r4300emu = CORE_INTERPRETER;
        init_blocks();
        jump_to(0xa4000040);

        /* Prevent segfault on failed jump_to */
        if (!actual->block)
            return;

        last_addr = PC->addr;
    }
}
Exemple #23
0
static void rom_input_event(int type, int key) {
    menu_list_input(list, type, key);

    if(type == SDL_KEYDOWN) {
        switch(key) {
            case SDLK_RIGHT:
                if(!direntries[list->selected]->is_file && strcmp(direntries[list->selected]->name, "..")) {
                    change_dir();
                }
            break;
            case SDLK_LEFT:
                parent_dir();
            break;
        }
        if(isprint(key)) {
            if(!jump_to(list->selected + 1, key)) {
                jump_to(0, key);
            }
        }
    }
}
Exemple #24
0
void J_OUT()
{
   jump_target = (PC->addr & 0xF0000000) | (PC->f.j.inst_index<<2);
   PC++;
   delay_slot=1;
   PC->ops();
   update_count();
   delay_slot=0;
   if (!skip_jump)
     jump_to(jump_target);
   last_addr = PC->addr;
   if (next_interupt <= Count) gen_interupt();
}
void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
    Label L;
    const Register temp_reg = G3_scratch;
    // Note: needs more testing of out-of-line vs. inline slow case
    verify_oop(receiver);
    load_klass(receiver, temp_reg);
    cmp_and_brx_short(temp_reg, iCache, Assembler::equal, Assembler::pt, L);
    AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub());
    jump_to(ic_miss, temp_reg);
    delayed()->nop();
    align(CodeEntryAlignment);
    bind(L);
}
Exemple #26
0
/*
************************************************************************************************************
*
*                                             function
*
*    name          :
*
*    parmeters     :
*
*    return        :
*
*    note          :
*
*
************************************************************************************************************
*/
int sunxi_board_run_fel(void)
{
#if defined(CONFIG_SUN6I) || defined(CONFIG_ARCH_SUN8IW3P1)|| defined(CONFIG_ARCH_SUN8IW5P1) || defined(CONFIG_ARCH_SUN7I)
	*((volatile unsigned int *)(SUNXI_RUN_EFEX_ADDR)) = SUNXI_RUN_EFEX_FLAG;
#elif defined(CONFIG_ARCH_SUN9IW1P1)
    volatile unsigned int *rtc_addr = (volatile unsigned int *)(0x08001400 + 0x1f0);

	do
	{
    	*rtc_addr = (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
        *rtc_addr = (1<<31) | (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
        __usdelay(10);
        *rtc_addr = (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
    }
    while((*rtc_addr & 0xff) != SUNXI_RUN_EFEX_FLAG);
#elif defined(CONFIG_ARCH_SUN8IW6P1)
        volatile unsigned int *rtc_addr = (volatile unsigned int *)(0x01f01400 + 0x1f0);
    
        do
        {
            *rtc_addr = (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
            *rtc_addr = (1<<31) | (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
            __usdelay(10);
            *rtc_addr = (1<<16) | (SUNXI_RUN_EFEX_FLAG<<8);
        }
        while((*rtc_addr & 0xff) != SUNXI_RUN_EFEX_FLAG);

#endif
	printf("set next system status\n");

	axp_set_next_poweron_status(PMU_PRE_SYS_MODE);

	board_display_set_exit_mode(0);
#ifdef CONFIG_SUNXI_DISPLAY
	drv_disp_exit();
#endif
	printf("sunxi_board_close_source\n");
	sunxi_board_close_source();

	sunxi_flush_allcaches();
#if defined(CONFIG_ARCH_SUN5I)
	printf("jump to fel_base\n");
	jump_to(FEL_BASE);
#else
	printf("reset cpu\n");

	reset_cpu(0);
#endif

	return 0;
}
void ShellBrowserChild::jump_to(LPCITEMIDLIST pidl)
{
	ShellDirectory* dir = NULL;

	if (!_cur_dir)
		_cur_dir = _root._entry;

	if (_cur_dir) {
		static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24);

		if (ILFindChild) {
			for(;;) {
				LPCITEMIDLIST child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl);
				if (!child_pidl || !child_pidl->mkid.cb)
					break;

				_cur_dir->smart_scan();

				dir = static_cast<ShellDirectory*>(_cur_dir->find_entry(child_pidl));
				if (!dir)
					break;

				jump_to(dir);
			}
		} else {
			_cur_dir->smart_scan();

			dir = static_cast<ShellDirectory*>(_cur_dir->find_entry(pidl));	// This is not correct in the common case, but works on the desktop level.

			if (dir)
				jump_to(dir);
		}
	}

	 // If not already called, now directly call UpdateFolderView() using pidl.
	if (!dir)
		UpdateFolderView(ShellFolder(pidl));
}
void generic_jump_to(uint32_t address)
{
   if (r4300emu == CORE_PURE_INTERPRETER)
      PC->addr = address;
   else
   {
#ifdef NEW_DYNAREC
      if (r4300emu == CORE_DYNAREC)
         last_addr = pcaddr;
      else
#endif
         jump_to(address);
   }
}
Exemple #29
0
void BC1T_OUT()
{
   if (check_cop1_unusable()) return;
   jump_target = (long)PC->f.i.immediate;
   PC++;
   delay_slot=1;
   PC->ops();
   update_count();
   delay_slot=0;
   if (!skip_jump && (FCR31 & 0x800000)!=0)
     jump_to(PC->addr + ((jump_target-1)<<2));
   last_addr = PC->addr;
   if (next_interupt <= Count) gen_interupt();
}
Exemple #30
0
void BGEZ_OUT()
{
   local_rs = irs;
   jump_target = (long)PC->f.i.immediate;
   PC++;
   delay_slot=1;
   PC->ops();
   update_count();
   delay_slot=0;
   if (!skip_jump && local_rs >= 0)
     jump_to(PC->addr + ((jump_target-1)<<2));
   last_addr = PC->addr;
   if (next_interupt <= Count) gen_interupt();
}