xreturn.py (5119:a4469f2919f3) | xreturn.py (5295:5268691561b4) |
---|---|
1# Copyright (c) 2007 The Hewlett-Packard Development Company 2# All rights reserved. 3# 4# Redistribution and use of this software in source and binary forms, 5# with or without modification, are permitted provided that the 6# following conditions are met: 7# 8# The software must be used only for Non-Commercial Use which means any --- 63 unchanged lines hidden (view full) --- 72 73 limm t2, imm 74 ld t1, ss, [1, t0, rsp] 75 # Check address of return 76 addi rsp, rsp, dsz 77 add rsp, rsp, t2 78 wripi t1, 0 79}; | 1# Copyright (c) 2007 The Hewlett-Packard Development Company 2# All rights reserved. 3# 4# Redistribution and use of this software in source and binary forms, 5# with or without modification, are permitted provided that the 6# following conditions are met: 7# 8# The software must be used only for Non-Commercial Use which means any --- 63 unchanged lines hidden (view full) --- 72 73 limm t2, imm 74 ld t1, ss, [1, t0, rsp] 75 # Check address of return 76 addi rsp, rsp, dsz 77 add rsp, rsp, t2 78 wripi t1, 0 79}; |
80 81def macroop RET_FAR { 82 .adjust_env oszIn64Override 83 84 # Get the return RIP 85 ld t1, ss, [1, t0, rsp] 86 87 # Get the return CS 88 ld t2, ss, [1, t0, rsp], dsz 89 90 # Get the rpl 91 andi t3, t2, 0x3 92 93 # Get the cpl 94 95 # Here we'd check if we're changing priviledge levels. We'll just hope 96 # that doesn't happen yet. 97 98 # Do stuff if they're equal 99 chks t4, t2, flags=(EZF,) 100 fault "new GeneralProtection(0)", flags=(CEZF,) 101 ld t3, flatseg, [1, t0, t4], addressSize=8, dataSize=8 102 wrdl cs, t3, t2 103 # There should be validity checks on the RIP checks here, but I'll do 104 # that later. 105 wrip t0, t1 106 bri t0, label("end") 107 108 # Do other stuff if they're not. 109end: 110 fault "NoFault" 111}; |
|
80''' | 112''' |