Re: [rvm-research] Resolving External References

Khaled Z Mahmoud <[email protected]> Wed, 6 Dec 2017 02:15:44 -0500
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <CAER=_eVqZz-zkq-9-uiJR4fiJmSc3c8+VMKFGgaw5fpAAqMzWw@mail.gmail.com>
Hi,

I have done a new fresh PoC on a newly cloned git repository.
Below is my diff.


*--- a/rvm/src/org/jikesrvm/runtime/BootRecord.java*

*+++ b/rvm/src/org/jikesrvm/runtime/BootRecord.java*

@@ -406,4 +406,5 @@ public class BootRecord {

   public Address sysPerfEventDisableIP;

   public Address sysPerfEventReadIP;



+  public Address testIP;

 }

*diff --git a/rvm/src/org/jikesrvm/runtime/SysCall.java
b/rvm/src/org/jikesrvm/runtime/SysCall.java*

*index d275602a4..a293c22cb 100644*

*--- a/rvm/src/org/jikesrvm/runtime/SysCall.java*

*+++ b/rvm/src/org/jikesrvm/runtime/SysCall.java*

@@ -481,5 +481,9 @@ public abstract class SysCall {



   @SysCallTemplate

   public abstract void sysStackAlignmentTest();

+

+  @SysCallTemplate

+  public abstract int test();

+

 }



*diff --git a/tools/bootloader/sys.h b/tools/bootloader/sys.h*

*index 1a99b5769..610f949a1 100644*

*--- a/tools/bootloader/sys.h*

*+++ b/tools/bootloader/sys.h*

@@ -325,6 +325,9 @@ EXTERNAL jfloat sysVaArgJfloat(va_list *ap);

 EXTERNAL jdouble sysVaArgJdouble(va_list *ap);

 EXTERNAL jobject sysVaArgJobject(va_list *ap);



+

+EXTERNAL int test();

+

 /** Only called externally from Java programs. */

 EXTERNAL void sysExit(int) NORETURN;


Implementation of test is in :


~/jikes/jikesrvm_untouched/tools/bootloader/kmahmou1.c

#include "sys.h"


EXTERNAL int test() {

    return 0;

}


On Wed, Dec 6, 2017 at 12:46 AM, Erik Brangs <[email protected]> wrote:

> Hi,
>
> On 06.12.2017 06:17, Khaled Z Mahmoud wrote:
> > I am now just experimenting with a simple function system call "int
> k_poc_sys_call"
> > I have added relevant declarations in :
> >
> > ./rvm/src/org/jikesrvm/runtime/SysCall.java
> >
> > ./rvm/src/org/jikesrvm/runtime/BootRecord.java
> >
> > ./rvm/src/org/jikesrvm/tools/header_gen/GenerateInterfaceDeclarations.
> java
> >
> > ./tools/bootloader/sys.h
> >
> > ./tools/bootImageRunner/sys.C
>
> This looks wrong. You should have either tools/bootloader or
> tools/bootImageRunner both not both. Also, you probably shouldn't need to
> modify GenerateInterfaceDeclarations.
>
> > And I am still getting the error of : [exec]
> /home/kmahmou1/jikes/jikesrvm/target/FullAdaptiveMarkSweep_x86_64-linux/libjvm.so:
> undefined reference to `k_poc_sys_call'
> >
> > This function simply returns 0. There is no reference to any external
> library.
>
> If you can produce a minimal diff against git HEAD for what you're trying
> to do, I could take a look. IIRC I also have an example patch somewhere
> that adds a new syscall. I could use that to write some documentation in
> the user guide but I might need a few days to make time for that.
>
>
> Kind regards,
>
> Erik Brangs
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Jikesrvm-researchers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
>



-- 
Regards,
Khaled Mahmoud

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers