Memory Map (S390): Difference between revisions

Jump to navigation Jump to search
m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
No edit summary
m (Bot: Replace deprecated source tag with syntaxhighlight)
 
Line 2:
 
== Detecting memory ==
<sourcesyntaxhighlight lang="c">
/* We are going to read in pairs of 1MiB and when we hit the memory limit we
* will instantly catch the program exception and stop counting, then it's just
Line 26:
return (size_t)probe;
}
</syntaxhighlight>
</source>
 
Now there needs to be a function to "catch" the exceptions recognized by the processor:
<sourcesyntaxhighlight lang="c">
/* Check if an address is valid - this only catches program exceptions to
* determine if it's valid or not */
Line 69:
return r;
}
</syntaxhighlight>
</source>
 
Some C compilers are known to crash or even ABEND during compilation if addresses of labels are taken via the && operator, alternatively using direct high-level assembler syntax:
 
<sourcesyntaxhighlight lang="asm">
* HwCheckAddress
* IN:
Line 114:
DC A(AMBIT+CATCHPCR)
TMPSAVE DS 1D
</syntaxhighlight>
</source>
 
== See also ===
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu