~ubuntu-branches/ubuntu/saucy/bochs/saucy-proposed

« back to all changes in this revision

Viewing changes to cpu/stack64.cc

  • Committer: Bazaar Package Importer
  • Author(s): David Futcher
  • Date: 2009-04-30 07:46:11 UTC
  • mfrom: (1.1.11 upstream) (4.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090430074611-6dih80a5mk2uvxhk
Tags: 2.3.7+20090416-1ubuntu1
* Merge from debian unstable (LP: #370427), remaining changes:
  - debian/patches/12_no-ssp.patch: Build bios with -fno-stack-protector
  - Add Replaces/Conflicts for bochsbios-qemu (<< 2.3.6-2)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/////////////////////////////////////////////////////////////////////////
2
 
// $Id: stack64.cc,v 1.41 2008/05/10 18:10:53 sshwarts Exp $
 
2
// $Id: stack64.cc,v 1.44 2009/03/10 16:28:01 sshwarts Exp $
3
3
/////////////////////////////////////////////////////////////////////////
4
4
//
5
5
//  Copyright (C) 2001  MandrakeSoft S.A.
22
22
//
23
23
//  You should have received a copy of the GNU Lesser General Public
24
24
//  License along with this library; if not, write to the Free Software
25
 
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
25
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA
26
26
/////////////////////////////////////////////////////////////////////////
27
27
 
28
28
#define NEED_CPU_REG_SHORTCUTS 1
34
34
 
35
35
void BX_CPP_AttrRegparmN(1) BX_CPU_C::POP_EqM(bxInstruction_c *i)
36
36
{
37
 
  BX_CPU_THIS_PTR speculative_rsp = 1;
38
 
  BX_CPU_THIS_PTR prev_rsp = RSP;
 
37
  RSP_SPECULATIVE;
39
38
 
40
39
  Bit64u val64 = pop_64();
41
40
 
42
41
  // Note: there is one little weirdism here.  It is possible to use
43
42
  // RSP in the modrm addressing. If used, the value of RSP after the
44
43
  // pop is used to calculate the address.
45
 
  BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
46
 
 
47
 
  write_virtual_qword_64(i->seg(), RMAddr(i), val64);
48
 
 
49
 
  BX_CPU_THIS_PTR speculative_rsp = 0;
 
44
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
 
45
 
 
46
  write_virtual_qword_64(i->seg(), eaddr, val64);
 
47
 
 
48
  RSP_COMMIT;
50
49
}
51
50
 
52
51
void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUSH_RRX(bxInstruction_c *i)
93
92
 
94
93
void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUSH_EqM(bxInstruction_c *i)
95
94
{
96
 
  BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
 
95
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
97
96
 
98
 
  Bit64u op1_64 = read_virtual_qword_64(i->seg(), RMAddr(i));
 
97
  Bit64u op1_64 = read_virtual_qword_64(i->seg(), eaddr);
99
98
 
100
99
  push_64(op1_64);
101
100
}
105
104
  Bit8u level = i->Ib2();
106
105
  level &= 0x1F;
107
106
 
108
 
  BX_CPU_THIS_PTR speculative_rsp = 1;
109
 
  BX_CPU_THIS_PTR prev_rsp = RSP;
 
107
  RSP_SPECULATIVE;
110
108
 
111
109
  push_64(RBP);
112
110
 
135
133
 
136
134
  RBP = frame_ptr64;
137
135
 
138
 
  BX_CPU_THIS_PTR speculative_rsp = 0;
 
136
  RSP_COMMIT;
139
137
}
140
138
 
141
139
void BX_CPP_AttrRegparmN(1) BX_CPU_C::LEAVE64(bxInstruction_c *i)