1# Copyright (c) 2007-2008 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 9# use which is NOT directed to receiving any direct monetary --- 70 unchanged lines hidden (view full) --- 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], ssz |
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 andi t0, t2, 0xFC, flags=(EZF,), dataSize=2 100 bri t0, label("processDescriptor"), flags=(CEZF,) 101 andi t3, t2, 0xF8, dataSize=8 102 andi t0, t2, 0x4, flags=(EZF,), dataSize=2 103 bri t0, label("globalDescriptor"), flags=(CEZF,) 104 ld t3, tsl, [1, t0, t3], dataSize=8 105 bri t0, label("processDescriptor") 106globalDescriptor: 107 ld t3, tsg, [1, t0, t3], dataSize=8 108processDescriptor: 109 chks t2, t3, IretCheck, dataSize=8 |
110 # There should be validity checks on the RIP checks here, but I'll do 111 # that later. |
112 wrdl reg, t3, t2 113 wrsel reg, t2 |
114 wrip t0, t1 115 bri t0, label("end") 116 117 # Do other stuff if they're not. 118end: 119 fault "NoFault" 120}; 121''' |