Skip to content

Commit 27bd7c6

Browse files
wkozaczuknyh
authored andcommitted
java: move java_api and jni_helpers to java modules
The java_api.* and jni_helpers.* are actually only used by java.cc and following httpserver java-related plugins: - httpserver-jolokia-plugin - httpserver-jvm-plugin - josvsym This patch moves the relevant code out from kernel and makes it part of java.so. Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com> Message-Id: <20200116042111.4833-1-jwkozaczuk@gmail.com>
1 parent 364d086 commit 27bd7c6

File tree

16 files changed

+28
-19
lines changed

16 files changed

+28
-19
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,6 @@ drivers += drivers/clock-common.o
817817
drivers += drivers/clockevent.o
818818
drivers += core/elf.o
819819
drivers += java/jvm/jvm_balloon.o
820-
drivers += java/jvm/java_api.o
821-
drivers += java/jvm/jni_helpers.o
822820
drivers += drivers/random.o
823821
drivers += drivers/zfs.o
824822
drivers += drivers/null.o

modules/httpserver-api/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ check-http:
107107
check-ssl:
108108
# Test SSL
109109
cd $(src) && \
110-
make image=httpserver-api.fg_ssl,certs,openjdk8-zulu-full,jetty && \
110+
make image=httpserver-api.daemon_ssl,certs,openjdk8-zulu-full,jetty && \
111111
PYTHONPATH=$(src)/scripts modules/httpserver-api/tests/testhttpserver-api.py \
112112
--cert modules/certs/build/client.pem \
113113
--key modules/certs/build/client.key \

modules/httpserver-api/module.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# httpserver will run regardless of an explicit command line
2323
# passed with "run.py -e".
2424
daemon = api.run_on_init(_exe + ' &!')
25+
daemon_ssl = api.run_on_init(_exe + ' --ssl &!')
2526

2627
fg = api.run(_exe)
2728

modules/httpserver-jolokia-plugin/jolokia.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <mutex>
1616
#include <memory>
1717
#include <regex>
18-
#include <java/jvm/jni_helpers.hh>
18+
#include "../java-base/jvm/jni_helpers.hh"
1919
#include "exception.hh"
2020

2121
using namespace httpserver::json;

modules/httpserver-jvm-plugin/jvm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include "jvm.hh"
99
#include "autogen/jvm.json.hh"
10-
#include "jvm/java_api.hh"
10+
#include "../java-base/jvm/java_api.hh"
1111
#include <string>
1212

1313
namespace httpserver {

modules/java-base/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include common.gmk
33
ifeq ($(arch),aarch64)
44
java-targets :=
55
else
6-
java-targets := obj/jni/monitor.so
6+
java-targets := obj/jni/monitor.so obj/jvm/jni_helpers.o obj/jvm/java_api.o
77
endif
88

99
module: all
@@ -13,6 +13,7 @@ all: $(init) $(java-targets)
1313
init:
1414
@echo " MKDIRS"
1515
$(call very-quiet, mkdir -p obj/jni)
16+
$(call very-quiet, mkdir -p obj/jvm)
1617
.PHONY: init
1718

1819
clean:

modules/java-base/common.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
21
INCLUDES = -I$(src)/arch/$(arch) -I$(src) -I$(src)/include -I$(src)/arch/common
32
INCLUDES += -I$(src)/include/glibc-compat
4-
INCLUDES += -isystem $(src)/external/$(arch)/acpica/source/include
53
INCLUDES += $(shell $(CXX) -E -xc++ - -v </dev/null 2>&1 | awk '/^End/ {exit} /^ .*c\+\+/ {print "-isystem" $$0}')
64
INCLUDES += -isystem $(src)/include/api
75
INCLUDES += -isystem $(src)/include/api/$(arch)
@@ -13,7 +11,9 @@ autodepend = -MD -MT $@ -MP
1311
COMMON_FLAGS = -g -Wall -fPIC $(INCLUDES) -O2 $(autodepend) -DCONF_debug_memory=0 -D_KERNEL
1412
CXXFLAGS = -std=c++11 $(COMMON_FLAGS)
1513
CFLAGS = -std=gnu99 $(COMMON_FLAGS)
14+
1615
src = $(shell readlink -f ../..)
16+
java-base-path := $(src)/modules/java-base
1717

1818
RM := /bin/rm
1919

modules/java-base/java.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include <osv/debug.hh>
1515
#include <java/jvm/jvm_balloon.hh>
1616
#include <osv/mempool.hh>
17-
#include <java/jvm/java_api.hh>
17+
#include "jvm/java_api.hh"
1818
#include "osv/version.hh"
19-
#include <java/jvm/jni_helpers.hh>
19+
#include "jvm/jni_helpers.hh"
2020
#include <osv/defer.hh>
2121
#include <osv/app.hh>
2222

0 commit comments

Comments
 (0)