aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/global.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-03-28 09:43:53 +0200
committerSverker Eriksson <[email protected]>2018-03-28 09:43:53 +0200
commitf274b4cb369e1d4d8474c80595a992959770abf9 (patch)
tree44c44d9101ee58a156bca56d2cde4e3963bf4ca8 /erts/emulator/beam/global.h
parentce212ce8241e57c344c55df53b20965181cc6756 (diff)
parent39cf4e75f31e9abe46c9fe39000368c1243fdcf3 (diff)
downloadotp-f274b4cb369e1d4d8474c80595a992959770abf9.tar.gz
otp-f274b4cb369e1d4d8474c80595a992959770abf9.tar.bz2
otp-f274b4cb369e1d4d8474c80595a992959770abf9.zip
Merge branch 'sverker/driver-taints/OTP-14960'
* sverker/driver-taints/OTP-14960: erts: Include foreign static linked drivers in taints erts: Fix harmless bug in macro IS_DRIVER_VERSION_GE erts: Remove our own NIF modules from "taints" erts: Refactor erts_static_nif_get_nif_init erts: Add dynamic loaded drivers to list of "taints"
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r--erts/emulator/beam/global.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index d853b2e352..7724231cd5 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -116,6 +116,7 @@ extern void erts_post_nif(struct enif_environment_t* env);
extern void erts_resource_stop(ErtsResource*, ErlNifEvent, int is_direct_call);
void erts_fire_nif_monitor(ErtsMonitor *tmon);
void erts_nif_demonitored(ErtsResource* resource);
+extern void erts_add_taint(Eterm mod_atom);
extern Eterm erts_nif_taints(Process* p);
extern void erts_print_nif_taints(fmtfn_t to, void* to_arg);
void erts_unload_nif(struct erl_module_nif* nif);
@@ -1150,7 +1151,7 @@ typedef struct {
#define ERTS_SPAWN_DRIVER 1
#define ERTS_SPAWN_EXECUTABLE 2
#define ERTS_SPAWN_ANY (ERTS_SPAWN_DRIVER | ERTS_SPAWN_EXECUTABLE)
-int erts_add_driver_entry(ErlDrvEntry *drv, DE_Handle *handle, int driver_list_locked);
+int erts_add_driver_entry(ErlDrvEntry *drv, DE_Handle *handle, int driver_list_locked, int taint);
void erts_destroy_driver(erts_driver_t *drv);
int erts_save_suspend_process_on_port(Port*, Process*);
Port *erts_open_driver(erts_driver_t*, Eterm, char*, SysDriverOpts*, int *, int *);
@@ -1175,8 +1176,17 @@ void erts_lcnt_update_port_locks(int enable);
#endif
/* driver_tab.c */
+typedef struct {
+ ErlDrvEntry* de;
+ int taint;
+} ErtsStaticDriver;
typedef void *(*ErtsStaticNifInitFPtr)(void);
-ErtsStaticNifInitFPtr erts_static_nif_get_nif_init(const char *name, int len);
+typedef struct ErtsStaticNifEntry_ {
+ const char *nif_name;
+ ErtsStaticNifInitFPtr nif_init;
+ int taint;
+} ErtsStaticNifEntry;
+ErtsStaticNifEntry* erts_static_nif_get_nif_init(const char *name, int len);
int erts_is_static_nif(void *handle);
void erts_init_static_drivers(void);