From: Cristiano Giuffrida Date: Sat, 18 Jul 2015 10:08:15 +0000 (+0200) Subject: ds: Add live update extensions. X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F3107%2F1;p=minix.git ds: Add live update extensions. Change-Id: I093c462ddad4a5e9b3dc39140f45f0e25e83bb55 --- diff --git a/minix/include/minix/sef.h b/minix/include/minix/sef.h index 49202ad9f..dc5a1beed 100644 --- a/minix/include/minix/sef.h +++ b/minix/include/minix/sef.h @@ -366,6 +366,7 @@ void sef_llvm_stack_refs_restore(char *stack_buff); int sef_llvm_state_transfer(sef_init_info_t *info); int sef_llvm_add_special_mem_region(void *addr, size_t len, const char* name); int sef_llvm_del_special_mem_region_by_addr(void *addr); +void sef_llvm_ds_st_init(void); void *sef_llvm_ac_mmap(void *buf, size_t len, int prot, int flags, int fd, off_t offset); int sef_llvm_ac_munmap(void *buf, size_t len); diff --git a/minix/lib/libsys/sef_llvm.c b/minix/lib/libsys/sef_llvm.c index 4f08fd972..90eb3d5f1 100644 --- a/minix/lib/libsys/sef_llvm.c +++ b/minix/lib/libsys/sef_llvm.c @@ -153,6 +153,17 @@ int sef_llvm_del_special_mem_region_by_addr(void *addr) return st_del_special_mmapped_region_by_addr(addr); } +/*===========================================================================* + * sef_llvm_ds_st_init * + *===========================================================================*/ +void sef_llvm_ds_st_init(void) +{ + extern void __attribute__((weak)) _magic_ds_st_init(void); + if (!_magic_ds_st_init) + return; + _magic_ds_st_init(); +} + /*===========================================================================* * sef_llvm_ac_mmap * *===========================================================================*/ diff --git a/minix/servers/ds/main.c b/minix/servers/ds/main.c index ed2892217..594732897 100644 --- a/minix/servers/ds/main.c +++ b/minix/servers/ds/main.c @@ -96,6 +96,9 @@ static void sef_local_startup() sef_setcb_init_fresh(sef_cb_init_fresh); sef_setcb_init_restart(sef_cb_init_fail); + /* Register state transfer callbacks. */ + sef_llvm_ds_st_init(); + /* No live update support for now. */ /* Let SEF perform startup. */