towards adding support for 64-bit architectures: registering relative memory addresses with contiki instead of fetching absolute addresses to java
This commit is contained in:
parent
a59cbaf19f
commit
11fa5a9a6b
4 changed files with 103 additions and 57 deletions
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: Level4.java,v 1.3 2007/09/18 11:35:11 fros4943 Exp $
|
||||
* $Id: Level4.java,v 1.4 2008/11/20 16:22:28 fros4943 Exp $
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
|
@ -45,7 +45,8 @@ public class Level4 {
|
|||
}
|
||||
|
||||
private native void doCount();
|
||||
private native int getRefAddress();
|
||||
|
||||
public native void setReferenceAddress(int addr);
|
||||
|
||||
public Level4() {
|
||||
// Configure logger
|
||||
|
@ -152,12 +153,9 @@ public class Level4 {
|
|||
System.exit(1);
|
||||
}
|
||||
|
||||
int absRefAddress = getRefAddress();
|
||||
System.out.println("Absolute reference address: 0x" + Integer.toHexString(absRefAddress));
|
||||
int relRefAddress = (Integer) addresses.get("ref_var");
|
||||
System.out.println("Relative reference address: 0x" + Integer.toHexString(relRefAddress));
|
||||
int offsetRelToAbs = absRefAddress - relRefAddress;
|
||||
System.out.println("Offset relative-absolute: 0x" + Integer.toHexString(offsetRelToAbs));
|
||||
setReferenceAddress(relRefAddress);
|
||||
|
||||
doCount();
|
||||
doCount();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue