Mini-OS: hide mini-os internal symbols
Subsystems (5)
v3 cover Mini-OS: hide mini-os internal symbols
In order to avoid conflicts due to symbols with the same name when linking Mini-OS with an application, hide all Mini9-OS internal symbols from the application by linking the Mini-OS kernel individually and then removing all symbols which should be used internally only.
Changes in V2:
- added more symbols in patch 2
Changes in V3:
- Instead of a global file with symbol names use EXPORT_SYMBOL() instances for each symbol. Former patch 2 is replaced with new patches 2-32.
Juergen Gross (32):
Mini-OS: link kernel separately
Mini-OS: explicitly mark symbols to be visible for apps
Mini-OS: add EXPORT_SYMBOL() instances to kernel.c
Mini-OS: add EXPORT_SYMBOL() instances to hypervisor.c
Mini-OS: add EXPORT_SYMBOL() instances to sched.c
Mini-OS: add EXPORT_SYMBOL() instances to mm.c
Mini-OS: add EXPORT_SYMBOL() instances to lib/sys.c
Mini-OS: add EXPORT_SYMBOL() instances to lib/string.c
Mini-OS: add EXPORT_SYMBOL() instances to lib/math.c
Mini-OS: add EXPORT_SYMBOL() instances to lib/printf.c
Mini-OS: add EXPORT_SYMBOL() instances to lib/ctype.c
Mini-OS: add EXPORT_SYMBOL() instances to lib/xmalloc.c
Mini-OS: add EXPORT_SYMBOL() instances to lib/xs.c
Mini-OS: add EXPORT_SYMBOL() instances to main.c
Mini-OS: add EXPORT_SYMBOL() instances to console.c
Mini-OS: add EXPORT_SYMBOL() instances to events.c
Mini-OS: add EXPORT_SYMBOL() instances to gntmap.c
Mini-OS: add EXPORT_SYMBOL() instances to gnttab.c
Mini-OS: add EXPORT_SYMBOL() instances to ioremap.c
Mini-OS: add EXPORT_SYMBOL() instances to lock.c
Mini-OS: add EXPORT_SYMBOL() instances to time.c
Mini-OS: add EXPORT_SYMBOL() instances to lwip-*.c
Mini-OS: add EXPORT_SYMBOL() instances to 9pfront.c
Mini-OS: add EXPORT_SYMBOL() instances to blkfront.c
Mini-OS: add EXPORT_SYMBOL() instances to fbfront.c
Mini-OS: add EXPORT_SYMBOL() instances to netfront.c
Mini-OS: add EXPORT_SYMBOL() instances to pcifront.c
Mini-OS: add EXPORT_SYMBOL() instances to tpmback.c
Mini-OS: add EXPORT_SYMBOL() instances to tpmfront.c
Mini-OS: add EXPORT_SYMBOL() instances to tpm_tis.c
Mini-OS: add EXPORT_SYMBOL() instances to xenbus.c
Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()
.gitignore | 1 + 9pfront.c | 2 + Makefile | 11 ++++-- arch/arm/mm.c | 2 + arch/arm/time.c | 1 + arch/x86/ioremap.c | 5 ++- arch/x86/mm.c | 5 +++ arch/x86/sched.c | 5 +++ arch/x86/time.c | 2 +- blkfront.c | 12 ++++-- console.c | 5 +++ events.c | 7 ++++ fbfront.c | 11 +++++- gntmap.c | 5 +++ gnttab.c | 6 +++ hypervisor.c | 5 +++ include/export.h | 10 +++++ include/lib.h | 1 + kernel.c | 5 +++ lib/ctype.c | 2 + lib/math.c | 6 +++ lib/printf.c | 10 ++++- lib/string.c | 18 +++++++++ lib/sys.c | 92 +++++++++++++++++++++++++++++++++++++++++++--- lib/xmalloc.c | 3 ++ lib/xs.c | 10 +++++ lock.c | 9 ++++- lwip-arch.c | 9 +++++ lwip-net.c | 2 +- main.c | 3 ++ mm.c | 4 ++ netfront.c | 7 ++++ pcifront.c | 11 +++++- sched.c | 7 ++++ tpm_tis.c | 5 +++ tpmback.c | 11 ++++++ tpmfront.c | 6 +++ xenbus.c | 23 ++++++++++++ 38 files changed, 320 insertions(+), 19 deletions(-) create mode 100644 include/export.h
Signature · 1 line
2.35.3
PATCH v3 1/32 Mini-OS: link kernel separately
Add an additional link step with linking all Mini-OS kernel binaries into a single object file.
This is done in preparation of hiding Mini-OS internal symbols before linking the kernel with libraries and an application.
--- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Makefile +5 -2
@@ -164,8 +164,11 @@ endif $(OBJ_DIR)/arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S $(CPP) $(ASFLAGS) -P $< -o $@ -$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds - $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o [email protected] +$(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds + $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@ + +$(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) + $(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o [email protected] $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start [email protected] [email protected] $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) [email protected] $(EXTRA_OBJS) -o $@-debug strip -s $@-debug -o $@
Signature · 1 line
2.35.3
PATCH v3 2/32 Mini-OS: explicitly mark symbols to be visible for apps
In reply to Juergen GrossAdd an EXPORT_SYMBOL() macro to explicitly mark a symbol to be visible for an app or library linked with Mini-OS. This prepares hiding all other symbols from external components, avoiding any problems with duplicate symbol names.
---
V3:
- new patch
--- .gitignore | 1 + Makefile | 3 ++- include/export.h | 10 ++++++++++ include/lib.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 include/export.h
.gitignore +1 -0
@@ -16,3 +16,4 @@ mini-os.gz minios-config.mk mini-os-debug mini-os-debug.gz +syms
Makefile +2 -1
@@ -166,10 +166,11 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S $(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@ + $(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@ $(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o [email protected] - $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start [email protected] [email protected] + $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start --remove-section=.export_symbol [email protected] [email protected] $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) [email protected] $(EXTRA_OBJS) -o $@-debug strip -s $@-debug -o $@ gzip -n -f -9 -c $@-debug >[email protected]
include/export.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef _EXPORT_H_ +#define _EXPORT_H_ + +/* Mark a symbol to be visible for apps and libs. */ +#define EXPORT_SYMBOL (sym) \ + asm(".section .export_symbol\n" \ + ".ascii \""#sym"\\n\"\n" \ + ".previous\n") + +#endif /* _EXPORT_H_ */
include/lib.h +1 -0
@@ -53,6 +53,7 @@#include <stddef.h> #include <xen/xen.h> #include <xen/event_channel.h> +#include <mini-os/export.h> #include "gntmap.h" #if __GNUC__ >4 || (__GNUC__ ==4 && __GNUC_MINOR__ >=6 )
Signature · 1 line
2.35.3
Re: [PATCH v3 02/32] Mini-OS: explicitly mark symbols to be visible for apps
Juergen Gross, le lun. 27 nov. 2023 11:24:53 +0100, a ecrit:
Quoted 6 lines
Add an
EXPORT_SYMBOL()macro to explicitly mark a symbol to be visible for an app or library linked with Mini-OS. This prepares hiding all other symbols from external components, avoiding any problems with duplicate symbol names.Signed-off-by Juergen Gross <[email protected]>
Quoted 68 lines
---
V3:
- new patch--- .gitignore | 1 + Makefile | 3 ++- include/export.h | 10 ++++++++++ include/lib.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 include/export.h.gitignore +1
-0@@ -16,3 +16,4 @@ mini-os.gz minios-config.mk mini-os-debug mini-os-debug.gz +symsMakefile +2
-1@@ -166,10 +166,11 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S $(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@ + $(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@ $(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o [email protected] - $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start [email protected] [email protected] + $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start --remove-section=.export_symbol [email protected] [email protected] $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) [email protected] $(EXTRA_OBJS) -o $@-debug strip -s $@-debug -o $@ gzip -n -f -9 -c $@-debug >[email protected]include/export.h new file +10
-0@@ -0,0 +1,10 @@ +#ifndef _EXPORT_H_ +#define _EXPORT_H_ + +/* Mark a symbol to be visible for apps and libs. */ +#define EXPORT_SYMBOL (sym) \ + asm(".section .export_symbol\n" \ + ".ascii \""#sym"\\n\"\n" \ + ".previous\n") + +#endif /* _EXPORT_H_ */ include/lib.h +1
-0@@ -53,6 +53,7 @@#include <stddef.h> #include <xen/xen.h> #include <xen/event_channel.h> +#include <mini-os/export.h> #include "gntmap.h" #if __GNUC__ >4 || (__GNUC__ ==4 && __GNUC_MINOR__ >=6 )Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 3/32 Mini-OS: add EXPORT_SYMBOL() instances to kernel.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to kernel.c.
---
V3:
- new patch
--- kernel.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel.c +5 -0
@@ -50,6 +50,9 @@#include <xen/features.h> #include <xen/version.h> +void _start (void ); +EXPORT_SYMBOL (_start); +uint8_t xen_features[XENFEAT_NR_SUBMAPS *32 ];char cmdline[MAX_CMDLINE_SIZE ];
@@ -181,6 +184,7 @@ void stop_kernel(void)/* Reset arch details */ arch_fini (); } +EXPORT_SYMBOL (stop_kernel);/* * do_exit: This is called whenever an IRET fails in entry.S.
@@ -199,3 +203,4 @@ void do_exit(void)HYPERVISOR_sched_op (SCHEDOP_shutdown, &sched_shutdown); } } +EXPORT_SYMBOL (do_exit);
Signature · 1 line
2.35.3
Re: [PATCH v3 03/32] Mini-OS: add EXPORT_SYMBOL() instances to kernel.c
Juergen Gross, le lun. 27 nov. 2023 11:24:54 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tokernel.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 37 lines
---
V3:
- new patch--- kernel.c | 5 +++++ 1 file changed, 5 insertions(+)kernel.c +5
-0@@ -50,6 +50,9 @@#include <xen/features.h> #include <xen/version.h> +void _start (void ); +EXPORT_SYMBOL (_start); +uint8_t xen_features[XENFEAT_NR_SUBMAPS *32 ];char cmdline[MAX_CMDLINE_SIZE ];@@ -181,6 +184,7 @@ void stop_kernel(void)/* Reset arch details */ arch_fini (); } +EXPORT_SYMBOL (stop_kernel);/* * do_exit: This is called whenever an IRET fails in entry.S. @@ -199,3 +203,4 @@ void do_exit(void)HYPERVISOR_sched_op (SCHEDOP_shutdown, &sched_shutdown); } } +EXPORT_SYMBOL (do_exit);Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 4/32 Mini-OS: add EXPORT_SYMBOL() instances to hypervisor.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to hypervisor.c.
---
V3:
- new patch
--- hypervisor.c | 5 +++++ 1 file changed, 5 insertions(+)
hypervisor.c +5 -0
@@ -31,6 +31,8 @@#include <mini-os/events.h> #include <xen/memory.h> +EXPORT_SYMBOL (hypercall_page); +#define active_evtchns (cpu,sh,idx) \ ((sh)->evtchn_pending[idx] & \ ~(sh)->evtchn_mask[idx])
@@ -157,6 +159,7 @@ inline void mask_evtchn(uint32_t port)shared_info_t *s = HYPERVISOR_shared_info;synch_set_bit (port, &s->evtchn_mask[0 ]); } +EXPORT_SYMBOL (mask_evtchn);inline void unmask_evtchn (uint32_t port) {
@@ -180,9 +183,11 @@ inline void unmask_evtchn(uint32_t port)force_evtchn_callback (); } } +EXPORT_SYMBOL (unmask_evtchn);inline void clear_evtchn (uint32_t port) {shared_info_t *s = HYPERVISOR_shared_info;synch_clear_bit (port, &s->evtchn_pending[0 ]); } +EXPORT_SYMBOL (clear_evtchn);
Signature · 1 line
2.35.3
Re: [PATCH v3 04/32] Mini-OS: add EXPORT_SYMBOL() instances to hypervisor.c
Juergen Gross, le lun. 27 nov. 2023 11:24:55 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tohypervisor.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 43 lines
---
V3:
- new patch--- hypervisor.c | 5 +++++ 1 file changed, 5 insertions(+)hypervisor.c +5
-0@@ -31,6 +31,8 @@#include <mini-os/events.h> #include <xen/memory.h> +EXPORT_SYMBOL (hypercall_page); +#define active_evtchns (cpu,sh,idx) \ ((sh)->evtchn_pending[idx] & \ ~(sh)->evtchn_mask[idx])@@ -157,6 +159,7 @@ inline void mask_evtchn(uint32_t port)shared_info_t *s = HYPERVISOR_shared_info;synch_set_bit (port, &s->evtchn_mask[0 ]); } +EXPORT_SYMBOL (mask_evtchn);inline void unmask_evtchn (uint32_t port) {@@ -180,9 +183,11 @@ inline void unmask_evtchn(uint32_t port)force_evtchn_callback (); } } +EXPORT_SYMBOL (unmask_evtchn);inline void clear_evtchn (uint32_t port) {shared_info_t *s = HYPERVISOR_shared_info;synch_clear_bit (port, &s->evtchn_pending[0 ]); } +EXPORT_SYMBOL (clear_evtchn);Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 5/32 Mini-OS: add EXPORT_SYMBOL() instances to sched.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to sched.c.
---
V3:
- new patch
--- arch/x86/sched.c | 5 +++++ sched.c | 7 +++++++ 2 files changed, 12 insertions(+)
arch/x86/sched.c +5 -0
@@ -142,11 +142,13 @@ unsigned long __local_irq_save(void)local_irq_save (flags);return flags; } +EXPORT_SYMBOL (__local_irq_save);void __local_irq_restore (unsigned long flags) {local_irq_restore (flags); } +EXPORT_SYMBOL (__local_irq_restore);unsigned long __local_save_flags (void ) {
@@ -155,13 +157,16 @@ unsigned long __local_save_flags(void)local_save_flags (flags);return flags; } +EXPORT_SYMBOL (__local_save_flags);void __local_irq_disable (void ) {local_irq_disable (); } +EXPORT_SYMBOL (__local_irq_disable);void __local_irq_enable (void ) {local_irq_enable (); } +EXPORT_SYMBOL (__local_irq_enable);
sched.c +7 -0
@@ -128,6 +128,7 @@ void schedule(void) } } } +EXPORT_SYMBOL (schedule);struct thread *create_thread (char *name,void (*function)(void *),void *data) {
@@ -147,6 +148,7 @@ struct thread* create_thread(char *name, void (*function)(void *), void *data)local_irq_restore (flags);return thread; } +EXPORT_SYMBOL (create_thread);#ifdef HAVE_LIBC static struct _reent callback_reent;
@@ -184,6 +186,7 @@ struct _reent *__getreent(void)#endif return _reent; } +EXPORT_SYMBOL (__getreent);#endif void exit_thread (void )
@@ -205,12 +208,14 @@ void exit_thread(void)printk ("schedule() returned! Trying again\n" ); } } +EXPORT_SYMBOL (exit_thread);void block (struct thread *thread) { thread->wakeup_time =0LL ;clear_runnable (thread); } +EXPORT_SYMBOL (block);void msleep (uint32_t millisecs) {
@@ -219,12 +224,14 @@ void msleep(uint32_t millisecs)clear_runnable (thread);schedule (); } +EXPORT_SYMBOL (msleep);void wake (struct thread *thread) { thread->wakeup_time =0LL ;set_runnable (thread); } +EXPORT_SYMBOL (wake);void idle_thread_fn (void *unused) {
Signature · 1 line
2.35.3
Re: [PATCH v3 05/32] Mini-OS: add EXPORT_SYMBOL() instances to sched.c
Juergen Gross, le lun. 27 nov. 2023 11:24:56 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tosched.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 104 lines
---
V3:
- new patch--- arch/x86/sched.c | 5 +++++ sched.c | 7 +++++++ 2 files changed, 12 insertions(+)arch/x86/sched.c +5
-0@@ -142,11 +142,13 @@ unsigned long __local_irq_save(void)local_irq_save (flags);return flags; } +EXPORT_SYMBOL (__local_irq_save);void __local_irq_restore (unsigned long flags) {local_irq_restore (flags); } +EXPORT_SYMBOL (__local_irq_restore);unsigned long __local_save_flags (void ) {@@ -155,13 +157,16 @@ unsigned long __local_save_flags(void)local_save_flags (flags);return flags; } +EXPORT_SYMBOL (__local_save_flags);void __local_irq_disable (void ) {local_irq_disable (); } +EXPORT_SYMBOL (__local_irq_disable);void __local_irq_enable (void ) {local_irq_enable (); } +EXPORT_SYMBOL (__local_irq_enable);sched.c +7
-0@@ -128,6 +128,7 @@ void schedule(void) } } } +EXPORT_SYMBOL (schedule);struct thread *create_thread (char *name,void (*function)(void *),void *data) {@@ -147,6 +148,7 @@ struct thread* create_thread(char *name, void (*function)(void *), void *data)local_irq_restore (flags);return thread; } +EXPORT_SYMBOL (create_thread);#ifdef HAVE_LIBC static struct _reent callback_reent;@@ -184,6 +186,7 @@ struct _reent *__getreent(void)#endif return _reent; } +EXPORT_SYMBOL (__getreent);#endif void exit_thread (void )@@ -205,12 +208,14 @@ void exit_thread(void)printk ("schedule() returned! Trying again\n" ); } } +EXPORT_SYMBOL (exit_thread);void block (struct thread *thread) { thread->wakeup_time =0LL ;clear_runnable (thread); } +EXPORT_SYMBOL (block);void msleep (uint32_t millisecs) {@@ -219,12 +224,14 @@ void msleep(uint32_t millisecs)clear_runnable (thread);schedule (); } +EXPORT_SYMBOL (msleep);void wake (struct thread *thread) { thread->wakeup_time =0LL ;set_runnable (thread); } +EXPORT_SYMBOL (wake);void idle_thread_fn (void *unused) {Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 6/32 Mini-OS: add EXPORT_SYMBOL() instances to mm.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to mm.c.
---
V3:
- new patch
--- arch/arm/mm.c | 2 ++ arch/x86/mm.c | 5 +++++ mm.c | 4 ++++ 3 files changed, 11 insertions(+)
arch/arm/mm.c +2 -0
@@ -85,6 +85,7 @@ int do_map_frames(unsigned long addr, {return -ENOSYS ; } +EXPORT_SYMBOL (do_map_frames);/* Get Xen's suggested physical page assignments for the grant table. */ static paddr_t get_gnttab_base (void )
@@ -149,3 +150,4 @@ unsigned long map_frame_virt(unsigned long mfn) {return mfn_to_virt (mfn); } +EXPORT_SYMBOL (map_frame_virt);
arch/x86/mm.c +5 -0
@@ -493,6 +493,7 @@ pgentry_t *need_pgt(unsigned long va) offset =l1_table_offset (va);return &tab[offset]; } +EXPORT_SYMBOL (need_pgt);/* * Reserve an area of virtual address space for mappings and Heap
@@ -634,6 +635,7 @@ int do_map_frames(unsigned long va,return 0 ; } +EXPORT_SYMBOL (do_map_frames);/* * Map an array of MFNs contiguous into virtual address space. Virtual
@@ -654,6 +656,7 @@ void *map_frames_ex(const unsigned long *mfns, unsigned long n,return (void *)va; } +EXPORT_SYMBOL (map_frames_ex);/* * Unmap nun_frames frames mapped at virtual address va.
@@ -724,6 +727,7 @@ int unmap_frames(unsigned long va, unsigned long num_frames) }return 0 ; } +EXPORT_SYMBOL (unmap_frames);/* * Clear some of the bootstrap memory
@@ -859,3 +863,4 @@ unsigned long map_frame_virt(unsigned long mfn)return addr; } +EXPORT_SYMBOL (map_frame_virt);
mm.c +4 -0
@@ -280,6 +280,7 @@ unsigned long alloc_pages(int order)return 0 ; } +EXPORT_SYMBOL (alloc_pages);void free_pages (void *pointer,int order) {
@@ -336,6 +337,7 @@ void free_pages(void *pointer, int order) free_head[order] = freed_ch; } +EXPORT_SYMBOL (free_pages);int free_physical_pages (xen_pfn_t *mfns,int n) {
@@ -352,6 +354,7 @@ int map_frame_rw(unsigned long addr, unsigned long mfn) {return do_map_frames (addr, &mfn,1 ,1 ,1 ,DOMID_SELF ,NULL ,L1_PROT ); } +EXPORT_SYMBOL (map_frame_rw);#ifdef HAVE_LIBC void *sbrk (ptrdiff_t increment)
@@ -385,6 +388,7 @@ void *sbrk(ptrdiff_t increment) return (void *) old_brk; } +EXPORT_SYMBOL (sbrk);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 06/32] Mini-OS: add EXPORT_SYMBOL() instances to mm.c
Juergen Gross, le lun. 27 nov. 2023 11:24:57 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tomm.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 106 lines
---
V3:
- new patch--- arch/arm/mm.c | 2 ++ arch/x86/mm.c | 5 +++++ mm.c | 4 ++++ 3 files changed, 11 insertions(+)arch/arm/mm.c +2
-0@@ -85,6 +85,7 @@ int do_map_frames(unsigned long addr, {return -ENOSYS ; } +EXPORT_SYMBOL (do_map_frames);/* Get Xen's suggested physical page assignments for the grant table. */ static paddr_t get_gnttab_base (void )@@ -149,3 +150,4 @@ unsigned long map_frame_virt(unsigned long mfn) {return mfn_to_virt (mfn); } +EXPORT_SYMBOL (map_frame_virt);arch/x86/mm.c +5
-0@@ -493,6 +493,7 @@ pgentry_t *need_pgt(unsigned long va) offset =l1_table_offset (va);return &tab[offset]; } +EXPORT_SYMBOL (need_pgt);/* * Reserve an area of virtual address space for mappings and Heap @@ -634,6 +635,7 @@ int do_map_frames(unsigned long va,return 0 ; } +EXPORT_SYMBOL (do_map_frames);/* * Map an array of MFNs contiguous into virtual address space. Virtual @@ -654,6 +656,7 @@ void *map_frames_ex(const unsigned long *mfns, unsigned long n,return (void *)va; } +EXPORT_SYMBOL (map_frames_ex);/* * Unmap nun_frames frames mapped at virtual address va. @@ -724,6 +727,7 @@ int unmap_frames(unsigned long va, unsigned long num_frames) }return 0 ; } +EXPORT_SYMBOL (unmap_frames);/* * Clear some of the bootstrap memory @@ -859,3 +863,4 @@ unsigned long map_frame_virt(unsigned long mfn)return addr; } +EXPORT_SYMBOL (map_frame_virt);mm.c +4
-0@@ -280,6 +280,7 @@ unsigned long alloc_pages(int order)return 0 ; } +EXPORT_SYMBOL (alloc_pages);void free_pages (void *pointer,int order) {@@ -336,6 +337,7 @@ void free_pages(void *pointer, int order) free_head[order] = freed_ch; } +EXPORT_SYMBOL (free_pages);int free_physical_pages (xen_pfn_t *mfns,int n) {@@ -352,6 +354,7 @@ int map_frame_rw(unsigned long addr, unsigned long mfn) {return do_map_frames (addr, &mfn,1 ,1 ,1 ,DOMID_SELF ,NULL ,L1_PROT ); } +EXPORT_SYMBOL (map_frame_rw);#ifdef HAVE_LIBC void *sbrk (ptrdiff_t increment)@@ -385,6 +388,7 @@ void *sbrk(ptrdiff_t increment) return (void *) old_brk; } +EXPORT_SYMBOL (sbrk);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 7/32 Mini-OS: add EXPORT_SYMBOL() instances to lib/sys.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lib/sys.c.
---
V3:
- new patch
--- lib/sys.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 5 deletions(-)
lib/sys.c +87 -5
@@ -20,6 +20,7 @@#ifdef HAVE_LIBC #include <os.h> +#include <export.h> #include <string.h> #include <console.h> #include <sched.h>
@@ -63,7 +64,8 @@ { \ print_unsupported(#function); \ do_exit(); \ - } + } \ + EXPORT_SYMBOL(function)/* Log and err out on function call */ #define unsupported_function_log (type, function, ret) \
@@ -73,7 +75,8 @@ print_unsupported(#function); \ errno = ENOSYS; \ return ret; \ - } + } \ + EXPORT_SYMBOL(function)/* Err out on function call */ #define unsupported_function (type, function, ret) \
@@ -82,7 +85,8 @@ { \ errno =ENOSYS ; \return ret; \ - } + } \ + EXPORT_SYMBOL(function)#define NOFILE 32#define N_MOUNTS 16
@@ -187,6 +191,7 @@ unsigned int alloc_file_type(const struct file_ops *ops)return ret; } +EXPORT_SYMBOL (alloc_file_type);static const struct file_ops *get_file_ops (unsigned int type) {
@@ -203,8 +208,10 @@ struct file *get_file_from_fd(int fd)return (files[fd].type ==FTYPE_NONE ) ?NULL : files + fd; } +EXPORT_SYMBOL (get_file_from_fd);DECLARE_WAIT_QUEUE_HEAD (event_queue); +EXPORT_SYMBOL (event_queue);int alloc_fd (unsigned int type) {
@@ -222,6 +229,7 @@ int alloc_fd(unsigned int type)printk ("Too many opened files\n" );do_exit (); } +EXPORT_SYMBOL (alloc_fd);void close_all_files (void ) {
@@ -232,6 +240,7 @@ void close_all_files(void)close (i);pthread_mutex_unlock (&fd_lock); } +EXPORT_SYMBOL (close_all_files);int dup2 (int oldfd,int newfd) {
@@ -243,33 +252,39 @@ int dup2(int oldfd, int newfd)pthread_mutex_unlock (&fd_lock);return 0 ; } +EXPORT_SYMBOL (dup2);pid_t getpid (void ) {return 1 ; } +EXPORT_SYMBOL (getpid);pid_t getppid (void ) {return 1 ; } +EXPORT_SYMBOL (getppid);pid_t setsid (void ) {return 1 ; } +EXPORT_SYMBOL (setsid);char *getcwd (char *buf,size_t size) {snprintf (buf, size,"/" );return buf; } +EXPORT_SYMBOL (getcwd);int mkdir (const char *pathname,mode_t mode) { errno =EIO ;return -1 ; } +EXPORT_SYMBOL (mkdir);#ifdef CONFIG_CONSFRONT int posix_openpt (int flags)
@@ -282,6 +297,7 @@ int posix_openpt(int flags)return fd; } +EXPORT_SYMBOL (posix_openpt);static int open_pt (struct mount_point *mnt,const char *pathname,int flags,mode_t mode)
@@ -313,6 +329,8 @@ int posix_openpt(int flags) errno =EIO ;return -1 ; } +EXPORT_SYMBOL (posix_openpt); +int open_savefile (const char *path,int save) { errno =EIO ;
@@ -378,6 +396,8 @@ int open(const char *pathname, int flags, ...) errno =EIO ;return -1 ; } +EXPORT_SYMBOL (open); +EXPORT_SYMBOL (open64);int mount (const char *path,void *dev,int (*open)(struct mount_point *,const char *,int ,mode_t ))
@@ -422,6 +442,7 @@ int isatty(int fd) {return files[fd].type ==FTYPE_CONSOLE ; } +EXPORT_SYMBOL (isatty);int read (int fd,void *buf,size_t nbytes) {
@@ -440,6 +461,7 @@ int read(int fd, void *buf, size_t nbytes) errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (read);int write (int fd,const void *buf,size_t nbytes) {
@@ -458,6 +480,7 @@ int write(int fd, const void *buf, size_t nbytes) errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (write);off_t lseek_default (struct file *file,off_t offset,int whence) {
@@ -510,11 +533,14 @@ off_t lseek(int fd, off_t offset, int whence) errno =ESPIPE ;return (off_t) -1 ; } +EXPORT_SYMBOL (lseek); +EXPORT_SYMBOL (lseek64);int fsync (int fd) { errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (fsync);int close (int fd) {
@@ -542,6 +568,7 @@ int close(int fd) errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (close);static void init_stat (struct stat *buf) {
@@ -559,6 +586,7 @@ int stat(const char *path, struct stat *buf) errno =EIO ;return -1 ; } +EXPORT_SYMBOL (stat);int fstat (int fd,struct stat *buf) {
@@ -579,28 +607,34 @@ int fstat(int fd, struct stat *buf) errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (fstat); +EXPORT_SYMBOL (fstat64);int ftruncate (int fd,off_t length) { errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (ftruncate);int remove (const char *pathname) { errno =EIO ;return -1 ; } +EXPORT_SYMBOL (remove);int unlink (const char *pathname) {return remove (pathname); } +EXPORT_SYMBOL (unlink);int rmdir (const char *pathname) {return remove (pathname); } +EXPORT_SYMBOL (rmdir);int fcntl (int fd,int cmd, ...) {
@@ -635,6 +669,7 @@ int fcntl(int fd, int cmd, ...) errno =ENOSYS ;return -1 ; } +EXPORT_SYMBOL (fcntl);DIR *opendir (const char *name) {
@@ -648,11 +683,13 @@ DIR *opendir(const char *name) ret->has_more =1 ;return ret; } +EXPORT_SYMBOL (opendir);struct dirent *readdir (DIR *dir) {return NULL ; } +EXPORT_SYMBOL (readdir);int closedir (DIR *dir) {
@@ -664,6 +701,7 @@ int closedir(DIR *dir)free (dir);return 0 ; } +EXPORT_SYMBOL (closedir);/* We assume that only the main thread calls select(). */
@@ -732,6 +770,7 @@ bool select_read_flag(struct file *file) {return file->read; } +EXPORT_SYMBOL (select_read_flag);/* Just poll without blocking */ static int select_poll (int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds)
@@ -1044,6 +1083,7 @@ out:remove_waiter (console_w, console_queue);return ret; } +EXPORT_SYMBOL (select);/* Wrap around select */ int poll (struct pollfd _pfd[],nfds_t _nfds,int _timeout)
@@ -1136,6 +1176,7 @@ int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout)return n; } +EXPORT_SYMBOL (poll);#ifdef HAVE_LWIP int socket (int domain,int type,int protocol)
@@ -1149,6 +1190,7 @@ int socket(int domain, int type, int protocol) files[res].fd = fd;return res; } +EXPORT_SYMBOL (socket);int accept (int s,struct sockaddr *addr,socklen_t *addrlen) {
@@ -1166,6 +1208,7 @@ int accept(int s, struct sockaddr *addr, socklen_t *addrlen)printk ("accepted on %d -> %d\n" , s, res);return res; } +EXPORT_SYMBOL (accept);#define LWIP_STUB (ret, name, proto, args) \ ret name proto \
@@ -1180,15 +1223,25 @@ ret name proto \ } LWIP_STUB(int, bind, (int s, struct sockaddr *my_addr, socklen_t addrlen), (s, my_addr, addrlen)) +EXPORT_SYMBOL(bind); LWIP_STUB(int, getsockopt, (int s, int level, int optname, void *optval, socklen_t *optlen), (s, level, optname, optval, optlen)) +EXPORT_SYMBOL(getsockopt); LWIP_STUB(int, setsockopt, (int s, int level, int optname, void *optval, socklen_t optlen), (s, level, optname, optval, optlen)) +EXPORT_SYMBOL(setsockopt); LWIP_STUB(int, connect, (int s, struct sockaddr *serv_addr, socklen_t addrlen), (s, serv_addr, addrlen)) +EXPORT_SYMBOL (connect); LWIP_STUB(int, listen, (int s, int backlog), (s, backlog)); +EXPORT_SYMBOL (listen); LWIP_STUB(ssize_t, recv, (int s, void *buf, size_t len, int flags), (s, buf, len, flags)) +EXPORT_SYMBOL (recv); LWIP_STUB(ssize_t, recvfrom, (int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen), (s, buf, len, flags, from, fromlen)) +EXPORT_SYMBOL (recvfrom); LWIP_STUB(ssize_t, send, (int s, void *buf, size_t len, int flags), (s, buf, len, flags)) +EXPORT_SYMBOL (send); LWIP_STUB(ssize_t, sendto, (int s, void *buf, size_t len, int flags, struct sockaddr *to, socklen_t tolen), (s, buf, len, flags, to, tolen)) +EXPORT_SYMBOL (sendto); LWIP_STUB(int, getsockname, (int s, struct sockaddr *name, socklen_t *namelen), (s, name, namelen)) +EXPORT_SYMBOL (getsockname);#endif static char *syslog_ident;
@@ -1197,12 +1250,14 @@ void openlog(const char *ident, int option, int facility)free (syslog_ident); syslog_ident =strdup (ident); } +EXPORT_SYMBOL (openlog);void vsyslog (int priority,const char *format,va_list ap) {printk ("%s: " , syslog_ident);0 , format, ap); } +EXPORT_SYMBOL (vsyslog);void syslog (int priority,const char *format, ...) {
@@ -1211,12 +1266,14 @@ void syslog(int priority, const char *format, ...)vsyslog (priority, format, ap);va_end (ap); } +EXPORT_SYMBOL (syslog);void closelog (void ) {free (syslog_ident); syslog_ident =NULL ; } +EXPORT_SYMBOL (closelog);void vwarn (const char *format,va_list ap) {
@@ -1228,6 +1285,7 @@ void vwarn(const char *format, va_list ap) }printk ("%s" ,strerror (the_errno)); } +EXPORT_SYMBOL (vwarn);void warn (const char *format, ...) {
@@ -1236,12 +1294,14 @@ void warn(const char *format, ...)vwarn (format, ap);va_end (ap); } +EXPORT_SYMBOL (warn);void verr (int eval,const char *format,va_list ap) {vwarn (format, ap);exit (eval); } +EXPORT_SYMBOL (verr);void err (int eval,const char *format, ...) {
@@ -1250,6 +1310,7 @@ void err(int eval, const char *format, ...)verr (eval, format, ap);va_end (ap); } +EXPORT_SYMBOL (err);void vwarnx (const char *format,va_list ap) {
@@ -1257,6 +1318,7 @@ void vwarnx(const char *format, va_list ap)if (format)0 , format, ap); } +EXPORT_SYMBOL (vwarnx);void warnx (const char *format, ...) {
@@ -1265,12 +1327,14 @@ void warnx(const char *format, ...)vwarnx (format, ap);va_end (ap); } +EXPORT_SYMBOL (warnx);void verrx (int eval,const char *format,va_list ap) {vwarnx (format, ap);exit (eval); } +EXPORT_SYMBOL (verrx);void errx (int eval,const char *format, ...) {
@@ -1279,6 +1343,7 @@ void errx(int eval, const char *format, ...)verrx (eval, format, ap);va_end (ap); } +EXPORT_SYMBOL (errx);int nanosleep (const struct timespec *req,struct timespec *rem) {
@@ -1304,6 +1369,7 @@ int nanosleep(const struct timespec *req, struct timespec *rem)return 0 ; } +EXPORT_SYMBOL (nanosleep);int usleep (useconds_t usec) {
@@ -1317,6 +1383,7 @@ int usleep(useconds_t usec)return 0 ; } +EXPORT_SYMBOL (usleep);unsigned int sleep (unsigned int seconds) {
@@ -1332,6 +1399,7 @@ unsigned int sleep(unsigned int seconds)return rem.tv_sec; } +EXPORT_SYMBOL (sleep);int clock_gettime (clockid_t clk_id,struct timespec *tp) {
@@ -1364,37 +1432,44 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)return 0 ; } +EXPORT_SYMBOL (clock_gettime);uid_t getuid (void ) {return 0 ; } +EXPORT_SYMBOL (getuid);uid_t geteuid (void ) {return 0 ; } +EXPORT_SYMBOL (geteuid);gid_t getgid (void ) {return 0 ; } +EXPORT_SYMBOL (getgid);gid_t getegid (void ) {return 0 ; } +EXPORT_SYMBOL (getegid);int gethostname (char *name,size_t namelen) {strncpy (name,"mini-os" , namelen);return 0 ; } +EXPORT_SYMBOL (gethostname);size_t getpagesize (void ) {return PAGE_SIZE ; } +EXPORT_SYMBOL (getpagesize);void *mmap (void *start,size_t length,int prot,int flags,int fd,off_t offset) {
@@ -1412,6 +1487,8 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offsetreturn map_frames_ex (&first_mfn, n,0 ,1 ,1 ,DOMID_IO ,NULL , _PAGE_PRESENT|_PAGE_RW); }else ASSERT (0 ); } +EXPORT_SYMBOL (mmap); +EXPORT_SYMBOL (mmap64);int munmap (void *start,size_t length) {
@@ -1425,6 +1502,7 @@ int munmap(void *start, size_t length) }return 0 ; } +EXPORT_SYMBOL (munmap);void sparse (unsigned long data,size_t size) {
@@ -1465,6 +1543,7 @@ int nice(int inc)printk ("nice() stub called with inc=%d\n" , inc);return 0 ; } +EXPORT_SYMBOL (nice);/* Limited termios terminal settings support */ const struct termios default_termios = {0 ,/* iflag */
@@ -1512,6 +1591,7 @@ int tcsetattr(int fildes, int action, const struct termios *tios)return 0 ; } +EXPORT_SYMBOL (tcsetattr);int tcgetattr (int fildes,struct termios *tios) {
@@ -1545,6 +1625,7 @@ int tcgetattr(int fildes, struct termios *tios)return 0 ; } +EXPORT_SYMBOL (tcgetattr);void cfmakeraw (struct termios *tios) {
@@ -1555,6 +1636,7 @@ void cfmakeraw(struct termios *tios) tios->c_cflag &= ~(CSIZE |PARENB ); tios->c_cflag |=CS8 ; } +EXPORT_SYMBOL (cfmakeraw);/* Not supported by FS yet. */ unsupported_function_crash (link);
@@ -1659,8 +1741,8 @@ unsupported_function_log(int, ftruncate64, -1);unsupported_function_log (int, fchown,-1 );unsupported_function_log (int, fchmod,-1 );unsupported_function_crash (execvp); -unsupported_function_log(int, dup, -1) -unsupported_function_log(int, chroot, -1) +unsupported_function_log (int, dup,-1 ); +unsupported_function_log (int, chroot,-1 );unsupported_function_log (int, chown,-1 );unsupported_function_log (int, chmod,-1 );unsupported_function_crash (alarm);
Signature · 1 line
2.35.3
Re: [PATCH v3 07/32] Mini-OS: add EXPORT_SYMBOL() instances to lib/sys.c
Juergen Gross, le lun. 27 nov. 2023 11:24:58 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tolib/sys.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 560 lines
---
V3:
- new patch--- lib/sys.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 5 deletions(-)lib/sys.c +87
-5@@ -20,6 +20,7 @@#ifdef HAVE_LIBC #include <os.h> +#include <export.h> #include <string.h> #include <console.h> #include <sched.h> @@ -63,7 +64,8 @@ { \ print_unsupported(#function); \ do_exit(); \ - } + } \ + EXPORT_SYMBOL(function)/* Log and err out on function call */ #define unsupported_function_log (type, function, ret) \@@ -73,7 +75,8 @@ print_unsupported(#function); \ errno = ENOSYS; \ return ret; \ - } + } \ + EXPORT_SYMBOL(function)/* Err out on function call */ #define unsupported_function (type, function, ret) \@@ -82,7 +85,8 @@ { \ errno =ENOSYS ; \return ret; \ - } + } \ + EXPORT_SYMBOL(function)#define NOFILE 32#define N_MOUNTS 16@@ -187,6 +191,7 @@ unsigned int alloc_file_type(const struct file_ops *ops)return ret; } +EXPORT_SYMBOL (alloc_file_type);static const struct file_ops *get_file_ops (unsigned int type) {@@ -203,8 +208,10 @@ struct file *get_file_from_fd(int fd)return (files[fd].type ==FTYPE_NONE ) ?NULL : files + fd; } +EXPORT_SYMBOL (get_file_from_fd);DECLARE_WAIT_QUEUE_HEAD (event_queue); +EXPORT_SYMBOL (event_queue);int alloc_fd (unsigned int type) {@@ -222,6 +229,7 @@ int alloc_fd(unsigned int type)printk ("Too many opened files\n" );do_exit (); } +EXPORT_SYMBOL (alloc_fd);void close_all_files (void ) {@@ -232,6 +240,7 @@ void close_all_files(void)close (i);pthread_mutex_unlock (&fd_lock); } +EXPORT_SYMBOL (close_all_files);int dup2 (int oldfd,int newfd) {@@ -243,33 +252,39 @@ int dup2(int oldfd, int newfd)pthread_mutex_unlock (&fd_lock);return 0 ; } +EXPORT_SYMBOL (dup2);pid_t getpid (void ) {return 1 ; } +EXPORT_SYMBOL (getpid);pid_t getppid (void ) {return 1 ; } +EXPORT_SYMBOL (getppid);pid_t setsid (void ) {return 1 ; } +EXPORT_SYMBOL (setsid);char *getcwd (char *buf,size_t size) {snprintf (buf, size,"/" );return buf; } +EXPORT_SYMBOL (getcwd);int mkdir (const char *pathname,mode_t mode) { errno =EIO ;return -1 ; } +EXPORT_SYMBOL (mkdir);#ifdef CONFIG_CONSFRONT int posix_openpt (int flags)@@ -282,6 +297,7 @@ int posix_openpt(int flags)return fd; } +EXPORT_SYMBOL (posix_openpt);static int open_pt (struct mount_point *mnt,const char *pathname,int flags,mode_t mode)@@ -313,6 +329,8 @@ int posix_openpt(int flags) errno =EIO ;return -1 ; } +EXPORT_SYMBOL (posix_openpt); +int open_savefile (const char *path,int save) { errno =EIO ;@@ -378,6 +396,8 @@ int open(const char *pathname, int flags, ...) errno =EIO ;return -1 ; } +EXPORT_SYMBOL (open); +EXPORT_SYMBOL (open64);int mount (const char *path,void *dev,int (*open)(struct mount_point *,const char *,int ,mode_t ))@@ -422,6 +442,7 @@ int isatty(int fd) {return files[fd].type ==FTYPE_CONSOLE ; } +EXPORT_SYMBOL (isatty);int read (int fd,void *buf,size_t nbytes) {@@ -440,6 +461,7 @@ int read(int fd, void *buf, size_t nbytes) errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (read);int write (int fd,const void *buf,size_t nbytes) {@@ -458,6 +480,7 @@ int write(int fd, const void *buf, size_t nbytes) errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (write);off_t lseek_default (struct file *file,off_t offset,int whence) {@@ -510,11 +533,14 @@ off_t lseek(int fd, off_t offset, int whence) errno =ESPIPE ;return (off_t) -1 ; } +EXPORT_SYMBOL (lseek); +EXPORT_SYMBOL (lseek64);int fsync (int fd) { errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (fsync);int close (int fd) {@@ -542,6 +568,7 @@ int close(int fd) errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (close);static void init_stat (struct stat *buf) {@@ -559,6 +586,7 @@ int stat(const char *path, struct stat *buf) errno =EIO ;return -1 ; } +EXPORT_SYMBOL (stat);int fstat (int fd,struct stat *buf) {@@ -579,28 +607,34 @@ int fstat(int fd, struct stat *buf) errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (fstat); +EXPORT_SYMBOL (fstat64);int ftruncate (int fd,off_t length) { errno =EBADF ;return -1 ; } +EXPORT_SYMBOL (ftruncate);int remove (const char *pathname) { errno =EIO ;return -1 ; } +EXPORT_SYMBOL (remove);int unlink (const char *pathname) {return remove (pathname); } +EXPORT_SYMBOL (unlink);int rmdir (const char *pathname) {return remove (pathname); } +EXPORT_SYMBOL (rmdir);int fcntl (int fd,int cmd, ...) {@@ -635,6 +669,7 @@ int fcntl(int fd, int cmd, ...) errno =ENOSYS ;return -1 ; } +EXPORT_SYMBOL (fcntl);DIR *opendir (const char *name) {@@ -648,11 +683,13 @@ DIR *opendir(const char *name) ret->has_more =1 ;return ret; } +EXPORT_SYMBOL (opendir);struct dirent *readdir (DIR *dir) {return NULL ; } +EXPORT_SYMBOL (readdir);int closedir (DIR *dir) {@@ -664,6 +701,7 @@ int closedir(DIR *dir)free (dir);return 0 ; } +EXPORT_SYMBOL (closedir);/* We assume that only the main thread calls select(). */ @@ -732,6 +770,7 @@ bool select_read_flag(struct file *file) {return file->read; } +EXPORT_SYMBOL (select_read_flag);/* Just poll without blocking */ static int select_poll (int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds)@@ -1044,6 +1083,7 @@ out:remove_waiter (console_w, console_queue);return ret; } +EXPORT_SYMBOL (select);/* Wrap around select */ int poll (struct pollfd _pfd[],nfds_t _nfds,int _timeout)@@ -1136,6 +1176,7 @@ int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout)return n; } +EXPORT_SYMBOL (poll);#ifdef HAVE_LWIP int socket (int domain,int type,int protocol)@@ -1149,6 +1190,7 @@ int socket(int domain, int type, int protocol) files[res].fd = fd;return res; } +EXPORT_SYMBOL (socket);int accept (int s,struct sockaddr *addr,socklen_t *addrlen) {@@ -1166,6 +1208,7 @@ int accept(int s, struct sockaddr *addr, socklen_t *addrlen)printk ("accepted on %d -> %d\n" , s, res);return res; } +EXPORT_SYMBOL (accept);#define LWIP_STUB (ret, name, proto, args) \ ret name proto \@@ -1180,15 +1223,25 @@ ret name proto \ } LWIP_STUB(int, bind, (int s, struct sockaddr *my_addr, socklen_t addrlen), (s, my_addr, addrlen)) +EXPORT_SYMBOL(bind); LWIP_STUB(int, getsockopt, (int s, int level, int optname, void *optval, socklen_t *optlen), (s, level, optname, optval, optlen)) +EXPORT_SYMBOL(getsockopt); LWIP_STUB(int, setsockopt, (int s, int level, int optname, void *optval, socklen_t optlen), (s, level, optname, optval, optlen)) +EXPORT_SYMBOL(setsockopt); LWIP_STUB(int, connect, (int s, struct sockaddr *serv_addr, socklen_t addrlen), (s, serv_addr, addrlen)) +EXPORT_SYMBOL (connect); LWIP_STUB(int, listen, (int s, int backlog), (s, backlog)); +EXPORT_SYMBOL (listen); LWIP_STUB(ssize_t, recv, (int s, void *buf, size_t len, int flags), (s, buf, len, flags)) +EXPORT_SYMBOL (recv); LWIP_STUB(ssize_t, recvfrom, (int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen), (s, buf, len, flags, from, fromlen)) +EXPORT_SYMBOL (recvfrom); LWIP_STUB(ssize_t, send, (int s, void *buf, size_t len, int flags), (s, buf, len, flags)) +EXPORT_SYMBOL (send); LWIP_STUB(ssize_t, sendto, (int s, void *buf, size_t len, int flags, struct sockaddr *to, socklen_t tolen), (s, buf, len, flags, to, tolen)) +EXPORT_SYMBOL (sendto); LWIP_STUB(int, getsockname, (int s, struct sockaddr *name, socklen_t *namelen), (s, name, namelen)) +EXPORT_SYMBOL (getsockname);#endif static char *syslog_ident;@@ -1197,12 +1250,14 @@ void openlog(const char *ident, int option, int facility)free (syslog_ident); syslog_ident =strdup (ident); } +EXPORT_SYMBOL (openlog);void vsyslog (int priority,const char *format,va_list ap) {printk ("%s: " , syslog_ident);0 , format, ap); } +EXPORT_SYMBOL (vsyslog);void syslog (int priority,const char *format, ...) {@@ -1211,12 +1266,14 @@ void syslog(int priority, const char *format, ...)vsyslog (priority, format, ap);va_end (ap); } +EXPORT_SYMBOL (syslog);void closelog (void ) {free (syslog_ident); syslog_ident =NULL ; } +EXPORT_SYMBOL (closelog);void vwarn (const char *format,va_list ap) {@@ -1228,6 +1285,7 @@ void vwarn(const char *format, va_list ap) }printk ("%s" ,strerror (the_errno)); } +EXPORT_SYMBOL (vwarn);void warn (const char *format, ...) {@@ -1236,12 +1294,14 @@ void warn(const char *format, ...)vwarn (format, ap);va_end (ap); } +EXPORT_SYMBOL (warn);void verr (int eval,const char *format,va_list ap) {vwarn (format, ap);exit (eval); } +EXPORT_SYMBOL (verr);void err (int eval,const char *format, ...) {@@ -1250,6 +1310,7 @@ void err(int eval, const char *format, ...)verr (eval, format, ap);va_end (ap); } +EXPORT_SYMBOL (err);void vwarnx (const char *format,va_list ap) {@@ -1257,6 +1318,7 @@ void vwarnx(const char *format, va_list ap)if (format)0 , format, ap); } +EXPORT_SYMBOL (vwarnx);void warnx (const char *format, ...) {@@ -1265,12 +1327,14 @@ void warnx(const char *format, ...)vwarnx (format, ap);va_end (ap); } +EXPORT_SYMBOL (warnx);void verrx (int eval,const char *format,va_list ap) {vwarnx (format, ap);exit (eval); } +EXPORT_SYMBOL (verrx);void errx (int eval,const char *format, ...) {@@ -1279,6 +1343,7 @@ void errx(int eval, const char *format, ...)verrx (eval, format, ap);va_end (ap); } +EXPORT_SYMBOL (errx);int nanosleep (const struct timespec *req,struct timespec *rem) {@@ -1304,6 +1369,7 @@ int nanosleep(const struct timespec *req, struct timespec *rem)return 0 ; } +EXPORT_SYMBOL (nanosleep);int usleep (useconds_t usec) {@@ -1317,6 +1383,7 @@ int usleep(useconds_t usec)return 0 ; } +EXPORT_SYMBOL (usleep);unsigned int sleep (unsigned int seconds) {@@ -1332,6 +1399,7 @@ unsigned int sleep(unsigned int seconds)return rem.tv_sec; } +EXPORT_SYMBOL (sleep);int clock_gettime (clockid_t clk_id,struct timespec *tp) {@@ -1364,37 +1432,44 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)return 0 ; } +EXPORT_SYMBOL (clock_gettime);uid_t getuid (void ) {return 0 ; } +EXPORT_SYMBOL (getuid);uid_t geteuid (void ) {return 0 ; } +EXPORT_SYMBOL (geteuid);gid_t getgid (void ) {return 0 ; } +EXPORT_SYMBOL (getgid);gid_t getegid (void ) {return 0 ; } +EXPORT_SYMBOL (getegid);int gethostname (char *name,size_t namelen) {strncpy (name,"mini-os" , namelen);return 0 ; } +EXPORT_SYMBOL (gethostname);size_t getpagesize (void ) {return PAGE_SIZE ; } +EXPORT_SYMBOL (getpagesize);void *mmap (void *start,size_t length,int prot,int flags,int fd,off_t offset) {@@ -1412,6 +1487,8 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offsetreturn map_frames_ex (&first_mfn, n,0 ,1 ,1 ,DOMID_IO ,NULL , _PAGE_PRESENT|_PAGE_RW); }else ASSERT (0 ); } +EXPORT_SYMBOL (mmap); +EXPORT_SYMBOL (mmap64);int munmap (void *start,size_t length) {@@ -1425,6 +1502,7 @@ int munmap(void *start, size_t length) }return 0 ; } +EXPORT_SYMBOL (munmap);void sparse (unsigned long data,size_t size) {@@ -1465,6 +1543,7 @@ int nice(int inc)printk ("nice() stub called with inc=%d\n" , inc);return 0 ; } +EXPORT_SYMBOL (nice);/* Limited termios terminal settings support */ const struct termios default_termios = {0 ,/* iflag */ @@ -1512,6 +1591,7 @@ int tcsetattr(int fildes, int action, const struct termios *tios)return 0 ; } +EXPORT_SYMBOL (tcsetattr);int tcgetattr (int fildes,struct termios *tios) {@@ -1545,6 +1625,7 @@ int tcgetattr(int fildes, struct termios *tios)return 0 ; } +EXPORT_SYMBOL (tcgetattr);void cfmakeraw (struct termios *tios) {@@ -1555,6 +1636,7 @@ void cfmakeraw(struct termios *tios) tios->c_cflag &= ~(CSIZE |PARENB ); tios->c_cflag |=CS8 ; } +EXPORT_SYMBOL (cfmakeraw);/* Not supported by FS yet. */ unsupported_function_crash (link);@@ -1659,8 +1741,8 @@ unsupported_function_log(int, ftruncate64, -1);unsupported_function_log (int, fchown,-1 );unsupported_function_log (int, fchmod,-1 );unsupported_function_crash (execvp); -unsupported_function_log(int, dup, -1) -unsupported_function_log(int, chroot, -1) +unsupported_function_log (int, dup,-1 ); +unsupported_function_log (int, chroot,-1 );unsupported_function_log (int, chown,-1 );unsupported_function_log (int, chmod,-1 );unsupported_function_crash (alarm);Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 8/32 Mini-OS: add EXPORT_SYMBOL() instances to lib/string.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lib/string.c.
---
V3:
- new patch
--- lib/string.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
lib/string.c +18 -0
@@ -19,6 +19,7 @@*/ #include <strings.h> +#include <mini-os/export.h> /* newlib defines ffs but not ffsll or ffsl */ int __ffsti2 (long long int lli)
@@ -49,11 +50,13 @@ int ffsl (long int li) {return __ffsti2 ((long long int ) li); } +EXPORT_SYMBOL (ffsl);int ffsll (long long int lli) {return __ffsti2 (lli); } +EXPORT_SYMBOL (ffsll);#if !definedHAVE_LIBC
@@ -72,6 +75,7 @@ int memcmp(const void * cs,const void * ct,size_t count)break ;return res; } +EXPORT_SYMBOL (memcmp);void *memcpy (void * dest,const void *src,size_t count) {
@@ -83,6 +87,7 @@ void * memcpy(void * dest,const void *src,size_t count)return dest; } +EXPORT_SYMBOL (memcpy);int strncmp (const char * cs,const char * ct,size_t count) {
@@ -96,6 +101,7 @@ int strncmp(const char * cs,const char * ct,size_t count)return __res; } +EXPORT_SYMBOL (strncmp);int strcmp (const char * cs,const char * ct) {
@@ -108,6 +114,7 @@ int strcmp(const char * cs,const char * ct)return __res; } +EXPORT_SYMBOL (strcmp);char *strcpy (char * dest,const char *src) {
@@ -117,6 +124,7 @@ char * strcpy(char * dest,const char *src)/* nothing */ ;return tmp; } +EXPORT_SYMBOL (strcpy);char *strncpy (char * dest,const char *src,size_t count) {
@@ -127,6 +135,7 @@ char * strncpy(char * dest,const char *src,size_t count)return tmp; } +EXPORT_SYMBOL (strncpy);void *memset (void * s,int c,size_t count) {
@@ -137,6 +146,7 @@ void * memset(void * s,int c,size_t count)return s; } +EXPORT_SYMBOL (memset);size_t strnlen (const char * s,size_t count) {
@@ -146,6 +156,7 @@ size_t strnlen(const char * s, size_t count)/* nothing */ ;return sc - s; } +EXPORT_SYMBOL (strnlen);char *strcat (char * dest,const char * src)
@@ -159,6 +170,7 @@ char * strcat(char * dest, const char * src)return tmp; } +EXPORT_SYMBOL (strcat);size_t strlen (const char * s) {
@@ -168,6 +180,7 @@ size_t strlen(const char * s)/* nothing */ ;return sc - s; } +EXPORT_SYMBOL (strlen);char *strchr (const char * s,int c) {
@@ -176,6 +189,7 @@ char * strchr(const char * s, int c)return NULL ;return (char *)s; } +EXPORT_SYMBOL (strchr);char *strrchr (const char * s,int c) {
@@ -185,6 +199,7 @@ char * strrchr(const char * s, int c) res = s;return (char *)res; } +EXPORT_SYMBOL (strrchr);char *strstr (const char * s1,const char * s2) {
@@ -202,6 +217,7 @@ char * strstr(const char * s1,const char * s2) }return NULL ; } +EXPORT_SYMBOL (strstr);char *strdup (const char *x) {
@@ -211,6 +227,7 @@ char *strdup(const char *x)memcpy (res, x, l +1 );return res; } +EXPORT_SYMBOL (strdup);int ffs (int i) {
@@ -224,5 +241,6 @@ int ffs(int i) } while (i);return 0 ; } +EXPORT_SYMBOL (ffs);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 08/32] Mini-OS: add EXPORT_SYMBOL() instances to lib/string.c
Juergen Gross, le lun. 27 nov. 2023 11:24:59 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tolib/string.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 155 lines
---
V3:
- new patch--- lib/string.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)lib/string.c +18
-0@@ -19,6 +19,7 @@*/ #include <strings.h> +#include <mini-os/export.h> /* newlib defines ffs but not ffsll or ffsl */ int __ffsti2 (long long int lli)@@ -49,11 +50,13 @@ int ffsl (long int li) {return __ffsti2 ((long long int ) li); } +EXPORT_SYMBOL (ffsl);int ffsll (long long int lli) {return __ffsti2 (lli); } +EXPORT_SYMBOL (ffsll);#if !definedHAVE_LIBC @@ -72,6 +75,7 @@ int memcmp(const void * cs,const void * ct,size_t count)break ;return res; } +EXPORT_SYMBOL (memcmp);void *memcpy (void * dest,const void *src,size_t count) {@@ -83,6 +87,7 @@ void * memcpy(void * dest,const void *src,size_t count)return dest; } +EXPORT_SYMBOL (memcpy);int strncmp (const char * cs,const char * ct,size_t count) {@@ -96,6 +101,7 @@ int strncmp(const char * cs,const char * ct,size_t count)return __res; } +EXPORT_SYMBOL (strncmp);int strcmp (const char * cs,const char * ct) {@@ -108,6 +114,7 @@ int strcmp(const char * cs,const char * ct)return __res; } +EXPORT_SYMBOL (strcmp);char *strcpy (char * dest,const char *src) {@@ -117,6 +124,7 @@ char * strcpy(char * dest,const char *src)/* nothing */ ;return tmp; } +EXPORT_SYMBOL (strcpy);char *strncpy (char * dest,const char *src,size_t count) {@@ -127,6 +135,7 @@ char * strncpy(char * dest,const char *src,size_t count)return tmp; } +EXPORT_SYMBOL (strncpy);void *memset (void * s,int c,size_t count) {@@ -137,6 +146,7 @@ void * memset(void * s,int c,size_t count)return s; } +EXPORT_SYMBOL (memset);size_t strnlen (const char * s,size_t count) {@@ -146,6 +156,7 @@ size_t strnlen(const char * s, size_t count)/* nothing */ ;return sc - s; } +EXPORT_SYMBOL (strnlen);char *strcat (char * dest,const char * src)@@ -159,6 +170,7 @@ char * strcat(char * dest, const char * src)return tmp; } +EXPORT_SYMBOL (strcat);size_t strlen (const char * s) {@@ -168,6 +180,7 @@ size_t strlen(const char * s)/* nothing */ ;return sc - s; } +EXPORT_SYMBOL (strlen);char *strchr (const char * s,int c) {@@ -176,6 +189,7 @@ char * strchr(const char * s, int c)return NULL ;return (char *)s; } +EXPORT_SYMBOL (strchr);char *strrchr (const char * s,int c) {@@ -185,6 +199,7 @@ char * strrchr(const char * s, int c) res = s;return (char *)res; } +EXPORT_SYMBOL (strrchr);char *strstr (const char * s1,const char * s2) {@@ -202,6 +217,7 @@ char * strstr(const char * s1,const char * s2) }return NULL ; } +EXPORT_SYMBOL (strstr);char *strdup (const char *x) {@@ -211,6 +227,7 @@ char *strdup(const char *x)memcpy (res, x, l +1 );return res; } +EXPORT_SYMBOL (strdup);int ffs (int i) {@@ -224,5 +241,6 @@ int ffs(int i) } while (i);return 0 ; } +EXPORT_SYMBOL (ffs);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 9/32 Mini-OS: add EXPORT_SYMBOL() instances to lib/math.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lib/math.c.
---
V3:
- new patch
--- lib/math.c | 6 ++++++ 1 file changed, 6 insertions(+)
lib/math.c +6 -0
@@ -338,6 +338,7 @@ __qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq) tmp.ul[L ] =COMBINE (qspace[3 ], qspace[4 ]);return (tmp.q); } +EXPORT_SYMBOL (__qdivrem);/* * From
@@ -365,6 +366,7 @@ __divdi3(quad_t a, quad_t b) uq =__qdivrem (ua, ub, (u_quad_t *)0 );return (neg ? -uq : uq); } +EXPORT_SYMBOL (__divdi3);/* * From
@@ -379,6 +381,7 @@ __udivdi3(u_quad_t a, u_quad_t b) {return (__qdivrem (a, b, (u_quad_t *)0 )); } +EXPORT_SYMBOL (__udivdi3);/* * From
@@ -396,6 +399,7 @@ __umoddi3(u_quad_t a, u_quad_t b) (void )__qdivrem (a, b, &r);return (r); } +EXPORT_SYMBOL (__umoddi3);/* * Returns the quotient and places remainder in r
@@ -405,6 +409,7 @@ __udivmoddi4(u_quad_t a, u_quad_t b, u_quad_t *r) {return __qdivrem (a, b, r); } +EXPORT_SYMBOL (__udivmoddi4);/* * From
@@ -434,3 +439,4 @@ __moddi3(quad_t a, quad_t b) (void )__qdivrem (ua, ub, &ur);return (neg ? -ur : ur); } +EXPORT_SYMBOL (__moddi3);
Signature · 1 line
2.35.3
Re: [PATCH v3 09/32] Mini-OS: add EXPORT_SYMBOL() instances to lib/math.c
Juergen Gross, le lun. 27 nov. 2023 11:25:00 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tolib/math.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 59 lines
---
V3:
- new patch--- lib/math.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/math.c +6
-0@@ -338,6 +338,7 @@ __qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq) tmp.ul[L ] =COMBINE (qspace[3 ], qspace[4 ]);return (tmp.q); } +EXPORT_SYMBOL (__qdivrem);/* * From @@ -365,6 +366,7 @@ __divdi3(quad_t a, quad_t b) uq =__qdivrem (ua, ub, (u_quad_t *)0 );return (neg ? -uq : uq); } +EXPORT_SYMBOL (__divdi3);/* * From @@ -379,6 +381,7 @@ __udivdi3(u_quad_t a, u_quad_t b) {return (__qdivrem (a, b, (u_quad_t *)0 )); } +EXPORT_SYMBOL (__udivdi3);/* * From @@ -396,6 +399,7 @@ __umoddi3(u_quad_t a, u_quad_t b) (void )__qdivrem (a, b, &r);return (r); } +EXPORT_SYMBOL (__umoddi3);/* * Returns the quotient and places remainder in r @@ -405,6 +409,7 @@ __udivmoddi4(u_quad_t a, u_quad_t b, u_quad_t *r) {return __qdivrem (a, b, r); } +EXPORT_SYMBOL (__udivmoddi4);/* * From @@ -434,3 +439,4 @@ __moddi3(quad_t a, quad_t b) (void )__qdivrem (ua, ub, &ur);return (neg ? -ur : ur); } +EXPORT_SYMBOL (__moddi3);Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 10/32 Mini-OS: add EXPORT_SYMBOL() instances to lib/printf.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lib/printf.c.
---
V3:
- new patch
--- lib/printf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
lib/printf.c +9 -1
@@ -150,6 +150,7 @@ strtoul(const char *nptr, char **endptr, int base) *endptr = __DECONST(char *, any ? s - 1 : nptr);return (acc); } +EXPORT_SYMBOL (strtoul);/* * Convert a string to a quad integer.
@@ -241,6 +242,7 @@ strtoq(const char *nptr, char **endptr, int base) *endptr = __DECONST(char *, any ? s - 1 : nptr);return (acc); } +EXPORT_SYMBOL (strtoq);/* * Convert a string to an unsigned quad integer.
@@ -309,6 +311,7 @@ strtouq(const char *nptr, char **endptr, int base) *endptr = __DECONST(char *, any ? s - 1 : nptr);return (acc); } +EXPORT_SYMBOL (strtouq);/* * Scaled down version of printf(3).
@@ -585,6 +588,7 @@ number: }#undef PCHAR } +EXPORT_SYMBOL (vsnprintf);/** * snprintf - Format a string and place it in a buffer
@@ -603,6 +607,7 @@ int snprintf(char * buf, size_t size, const char *fmt, ...)va_end (args);return i; } +EXPORT_SYMBOL (snprintf);/** * vsprintf - Format a string and place it in a buffer
@@ -617,7 +622,7 @@ int vsprintf(char *buf, const char *fmt, va_list args) {return vsnprintf (buf,0xFFFFFFFFUL , fmt, args); } - +EXPORT_SYMBOL (vsprintf);/** * sprintf - Format a string and place it in a buffer
@@ -635,6 +640,7 @@ int sprintf(char * buf, const char *fmt, ...)va_end (args);return i; } +EXPORT_SYMBOL (sprintf);/* * Fill in the given table from the scanset at the given format
@@ -1214,6 +1220,7 @@ input_failure: match_failure:return (nassigned); } +EXPORT_SYMBOL (vsscanf);/** * sscanf - Unformat a buffer into a list of arguments
@@ -1231,5 +1238,6 @@ int sscanf(const char * buf, const char * fmt, ...)va_end (args); return i; } +EXPORT_SYMBOL (sscanf);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 10/32] Mini-OS: add EXPORT_SYMBOL() instances to lib/printf.c
Juergen Gross, le lun. 27 nov. 2023 11:25:01 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tolib/printf.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 86 lines
---
V3:
- new patch--- lib/printf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)lib/printf.c +9
-1@@ -150,6 +150,7 @@ strtoul(const char *nptr, char **endptr, int base) *endptr = __DECONST(char *, any ? s - 1 : nptr);return (acc); } +EXPORT_SYMBOL (strtoul);/* * Convert a string to a quad integer. @@ -241,6 +242,7 @@ strtoq(const char *nptr, char **endptr, int base) *endptr = __DECONST(char *, any ? s - 1 : nptr);return (acc); } +EXPORT_SYMBOL (strtoq);/* * Convert a string to an unsigned quad integer. @@ -309,6 +311,7 @@ strtouq(const char *nptr, char **endptr, int base) *endptr = __DECONST(char *, any ? s - 1 : nptr);return (acc); } +EXPORT_SYMBOL (strtouq);/* * Scaled down version of printf(3). @@ -585,6 +588,7 @@ number: }#undef PCHAR } +EXPORT_SYMBOL (vsnprintf);/** * snprintf - Format a string and place it in a buffer @@ -603,6 +607,7 @@ int snprintf(char * buf, size_t size, const char *fmt, ...)va_end (args);return i; } +EXPORT_SYMBOL (snprintf);/** * vsprintf - Format a string and place it in a buffer @@ -617,7 +622,7 @@ int vsprintf(char *buf, const char *fmt, va_list args) {return vsnprintf (buf,0xFFFFFFFFUL , fmt, args); } - +EXPORT_SYMBOL (vsprintf);/** * sprintf - Format a string and place it in a buffer @@ -635,6 +640,7 @@ int sprintf(char * buf, const char *fmt, ...)va_end (args);return i; } +EXPORT_SYMBOL (sprintf);/* * Fill in the given table from the scanset at the given format @@ -1214,6 +1220,7 @@ input_failure: match_failure:return (nassigned); } +EXPORT_SYMBOL (vsscanf);/** * sscanf - Unformat a buffer into a list of arguments @@ -1231,5 +1238,6 @@ int sscanf(const char * buf, const char * fmt, ...)va_end (args); return i; } +EXPORT_SYMBOL (sscanf);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 11/32 Mini-OS: add EXPORT_SYMBOL() instances to lib/ctype.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lib/ctype.c.
---
V3:
- new patch
--- lib/ctype.c | 2 ++ 1 file changed, 2 insertions(+)
lib/ctype.c +2 -0
@@ -1,5 +1,6 @@#ifndef HAVE_LIBC #include <ctype.h> +#include <mini-os/export.h> unsigned char _ctype[] = { _C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
@@ -26,4 +27,5 @@ _U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */ _U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L,/* 208-223 */ _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,/* 224-239 */ _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ +EXPORT_SYMBOL (_ctype);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 11/32] Mini-OS: add EXPORT_SYMBOL() instances to lib/ctype.c
Juergen Gross, le lun. 27 nov. 2023 11:25:02 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tolib/ctype.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 27 lines
---
V3:
- new patch--- lib/ctype.c | 2 ++ 1 file changed, 2 insertions(+)lib/ctype.c +2
-0@@ -1,5 +1,6 @@#ifndef HAVE_LIBC #include <ctype.h> +#include <mini-os/export.h> unsigned char _ctype[] = { _C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */@@ -26,4 +27,5 @@ _U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */ _U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L,/* 208-223 */ _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,/* 224-239 */ _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ +EXPORT_SYMBOL (_ctype);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 12/32 Mini-OS: add EXPORT_SYMBOL() instances to lib/xmalloc.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lib/xmalloc.c.
---
V3:
- new patch
--- lib/xmalloc.c | 3 +++ 1 file changed, 3 insertions(+)
lib/xmalloc.c +3 -0
@@ -271,6 +271,7 @@ void *malloc(size_t size) {return _xmalloc (size,DEFAULT_ALIGN ); } +EXPORT_SYMBOL (malloc);void *realloc (void *ptr,size_t size) {
@@ -301,11 +302,13 @@ void *realloc(void *ptr, size_t size) return new; } +EXPORT_SYMBOL (realloc);void free (void *ptr) {xfree (ptr); } +EXPORT_SYMBOL (free);#endif /*
Signature · 1 line
2.35.3
Re: [PATCH v3 12/32] Mini-OS: add EXPORT_SYMBOL() instances to lib/xmalloc.c
Juergen Gross, le lun. 27 nov. 2023 11:25:03 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tolib/xmalloc.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 36 lines
---
V3:
- new patch--- lib/xmalloc.c | 3 +++ 1 file changed, 3 insertions(+)lib/xmalloc.c +3
-0@@ -271,6 +271,7 @@ void *malloc(size_t size) {return _xmalloc (size,DEFAULT_ALIGN ); } +EXPORT_SYMBOL (malloc);void *realloc (void *ptr,size_t size) {@@ -301,11 +302,13 @@ void *realloc(void *ptr, size_t size) return new; } +EXPORT_SYMBOL (realloc);void free (void *ptr) {xfree (ptr); } +EXPORT_SYMBOL (free);#endif /* Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 13/32 Mini-OS: add EXPORT_SYMBOL() instances to lib/xs.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lib/xs.c.
---
V3:
- new patch
--- lib/xs.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
lib/xs.c +10 -0
@@ -64,6 +64,7 @@ struct xs_handle *xs_daemon_open()printk ("xs_daemon_open -> %d, %p\n" , fd, &file->dev);return (void *)(intptr_t ) fd; } +EXPORT_SYMBOL (xs_daemon_open);void xs_daemon_close (struct xs_handle *h) {
@@ -74,6 +75,7 @@ int xs_fileno(struct xs_handle *h) {return _xs_fileno (h); } +EXPORT_SYMBOL (xs_fileno);void *xs_read (struct xs_handle *h,xs_transaction_t t,const char *path,unsigned int *len)
@@ -92,6 +94,7 @@ void *xs_read(struct xs_handle *h, xs_transaction_t t, *len =strlen (value);return value; } +EXPORT_SYMBOL (xs_read);bool xs_write (struct xs_handle *h,xs_transaction_t t,const char *path,const void *data,unsigned int len)
@@ -110,6 +113,7 @@ bool xs_write(struct xs_handle *h, xs_transaction_t t, }return true; } +EXPORT_SYMBOL (xs_write);static bool xs_bool (char *reply) {
@@ -123,6 +127,7 @@ bool xs_rm(struct xs_handle *h, xs_transaction_t t, const char *path) {return xs_bool (xenbus_rm (t, path)); } +EXPORT_SYMBOL (xs_rm); static void *xs_talkv(struct xs_handle *h, xs_transaction_t t, enum xsd_sockmsg_type type,
@@ -163,6 +168,7 @@ char *xs_get_domain_path(struct xs_handle *h, unsigned int domid)return xs_single (h,XBT_NULL ,XS_GET_DOMAIN_PATH , domid_str,NULL ); } +EXPORT_SYMBOL (xs_get_domain_path);char **xs_directory (struct xs_handle *h,xs_transaction_t t,const char *path,unsigned int *num)
@@ -199,6 +205,7 @@ char **xs_directory(struct xs_handle *h, xs_transaction_t t,free (res);return entries; } +EXPORT_SYMBOL (xs_directory);bool xs_watch (struct xs_handle *h,const char *path,const char *token) {
@@ -208,6 +215,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)return xs_bool (xenbus_watch_path_token (XBT_NULL , path, token, (xenbus_event_queue *)&file->dev)); } +EXPORT_SYMBOL (xs_watch);char **xs_read_watch (struct xs_handle *h,unsigned int *num) {
@@ -220,10 +228,12 @@ char **xs_read_watch(struct xs_handle *h, unsigned int *num) *num =2 ; return (char **) &event->path; } +EXPORT_SYMBOL (xs_read_watch);bool xs_unwatch (struct xs_handle *h,const char *path,const char *token) {printk ("xs_unwatch(%s, %s)\n" , path, token);return xs_bool (xenbus_unwatch_path_token (XBT_NULL , path, token)); } +EXPORT_SYMBOL (xs_unwatch);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 13/32] Mini-OS: add EXPORT_SYMBOL() instances to lib/xs.c
Juergen Gross, le lun. 27 nov. 2023 11:25:04 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tolib/xs.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 91 lines
---
V3:
- new patch--- lib/xs.c | 10 ++++++++++ 1 file changed, 10 insertions(+)lib/xs.c +10
-0@@ -64,6 +64,7 @@ struct xs_handle *xs_daemon_open()printk ("xs_daemon_open -> %d, %p\n" , fd, &file->dev);return (void *)(intptr_t ) fd; } +EXPORT_SYMBOL (xs_daemon_open);void xs_daemon_close (struct xs_handle *h) {@@ -74,6 +75,7 @@ int xs_fileno(struct xs_handle *h) {return _xs_fileno (h); } +EXPORT_SYMBOL (xs_fileno);void *xs_read (struct xs_handle *h,xs_transaction_t t,const char *path,unsigned int *len)@@ -92,6 +94,7 @@ void *xs_read(struct xs_handle *h, xs_transaction_t t, *len =strlen (value);return value; } +EXPORT_SYMBOL (xs_read);bool xs_write (struct xs_handle *h,xs_transaction_t t,const char *path,const void *data,unsigned int len)@@ -110,6 +113,7 @@ bool xs_write(struct xs_handle *h, xs_transaction_t t, }return true; } +EXPORT_SYMBOL (xs_write);static bool xs_bool (char *reply) {@@ -123,6 +127,7 @@ bool xs_rm(struct xs_handle *h, xs_transaction_t t, const char *path) {return xs_bool (xenbus_rm (t, path)); } +EXPORT_SYMBOL (xs_rm); static void *xs_talkv(struct xs_handle *h, xs_transaction_t t, enum xsd_sockmsg_type type,@@ -163,6 +168,7 @@ char *xs_get_domain_path(struct xs_handle *h, unsigned int domid)return xs_single (h,XBT_NULL ,XS_GET_DOMAIN_PATH , domid_str,NULL ); } +EXPORT_SYMBOL (xs_get_domain_path);char **xs_directory (struct xs_handle *h,xs_transaction_t t,const char *path,unsigned int *num)@@ -199,6 +205,7 @@ char **xs_directory(struct xs_handle *h, xs_transaction_t t,free (res);return entries; } +EXPORT_SYMBOL (xs_directory);bool xs_watch (struct xs_handle *h,const char *path,const char *token) {@@ -208,6 +215,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)return xs_bool (xenbus_watch_path_token (XBT_NULL , path, token, (xenbus_event_queue *)&file->dev)); } +EXPORT_SYMBOL (xs_watch);char **xs_read_watch (struct xs_handle *h,unsigned int *num) {@@ -220,10 +228,12 @@ char **xs_read_watch(struct xs_handle *h, unsigned int *num) *num =2 ; return (char **) &event->path; } +EXPORT_SYMBOL (xs_read_watch);bool xs_unwatch (struct xs_handle *h,const char *path,const char *token) {printk ("xs_unwatch(%s, %s)\n" , path, token);return xs_bool (xenbus_unwatch_path_token (XBT_NULL , path, token)); } +EXPORT_SYMBOL (xs_unwatch);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 14/32 Mini-OS: add EXPORT_SYMBOL() instances to main.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to main.c.
---
V3:
- new patch
--- main.c | 3 +++ 1 file changed, 3 insertions(+)
main.c +3 -0
@@ -38,10 +38,12 @@ int main(int argc, char *argv[], char *envp[])void _init (void ) { } +EXPORT_SYMBOL (_init);void _fini (void ) { } +EXPORT_SYMBOL (_fini);extern char __app_bss_start, __app_bss_end;static void call_main (void *p)
@@ -189,6 +191,7 @@ void _exit(int ret) }do_exit (); } +EXPORT_SYMBOL (_exit);int app_main (void *p) {
Signature · 1 line
2.35.3
Re: [PATCH v3 14/32] Mini-OS: add EXPORT_SYMBOL() instances to main.c
Juergen Gross, le lun. 27 nov. 2023 11:25:05 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tomain.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 35 lines
---
V3:
- new patch--- main.c | 3 +++ 1 file changed, 3 insertions(+)main.c +3
-0@@ -38,10 +38,12 @@ int main(int argc, char *argv[], char *envp[])void _init (void ) { } +EXPORT_SYMBOL (_init);void _fini (void ) { } +EXPORT_SYMBOL (_fini);extern char __app_bss_start, __app_bss_end;static void call_main (void *p)@@ -189,6 +191,7 @@ void _exit(int ret) }do_exit (); } +EXPORT_SYMBOL (_exit);int app_main (void *p) {Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 15/32 Mini-OS: add EXPORT_SYMBOL() instances to console.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to console.c.
---
V3:
- new patch
--- console.c | 5 +++++ 1 file changed, 5 insertions(+)
console.c +5 -0
@@ -125,6 +125,7 @@ void console_print(struct consfront_dev *dev, const char *data, int length)ring_send_fn (dev, copied_ptr, length); } +EXPORT_SYMBOL (console_print);void int direct,const char *fmt,va_list args) {
@@ -155,6 +156,7 @@ void printk(const char *fmt, ...)0 , fmt, args);va_end (args); } +EXPORT_SYMBOL (printk);void xprintk (const char *fmt, ...) {
@@ -164,6 +166,8 @@ void xprintk(const char *fmt, ...)1 , fmt, args);va_end (args); } +EXPORT_SYMBOL (xprintk); +void init_console (void ) {printk ("Initialising console ... " );
@@ -320,6 +324,7 @@ int xencons_ring_avail(struct consfront_dev *dev)return prod - cons; } +EXPORT_SYMBOL (xencons_ring_avail);int xencons_ring_recv (struct consfront_dev *dev,char *data,unsigned int len) {
Signature · 1 line
2.35.3
Re: [PATCH v3 15/32] Mini-OS: add EXPORT_SYMBOL() instances to console.c
Juergen Gross, le lun. 27 nov. 2023 11:25:06 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()toconsole.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 47 lines
---
V3:
- new patch--- console.c | 5 +++++ 1 file changed, 5 insertions(+)console.c +5
-0@@ -125,6 +125,7 @@ void console_print(struct consfront_dev *dev, const char *data, int length)ring_send_fn (dev, copied_ptr, length); } +EXPORT_SYMBOL (console_print);void int direct,const char *fmt,va_list args) {@@ -155,6 +156,7 @@ void printk(const char *fmt, ...)0 , fmt, args);va_end (args); } +EXPORT_SYMBOL (printk);void xprintk (const char *fmt, ...) {@@ -164,6 +166,8 @@ void xprintk(const char *fmt, ...)1 , fmt, args);va_end (args); } +EXPORT_SYMBOL (xprintk); +void init_console (void ) {printk ("Initialising console ... " );@@ -320,6 +324,7 @@ int xencons_ring_avail(struct consfront_dev *dev)return prod - cons; } +EXPORT_SYMBOL (xencons_ring_avail);int xencons_ring_recv (struct consfront_dev *dev,char *data,unsigned int len) {Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 16/32 Mini-OS: add EXPORT_SYMBOL() instances to events.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to events.c.
---
V3:
- new patch
--- events.c | 7 +++++++ 1 file changed, 7 insertions(+)
events.c +7 -0
@@ -119,6 +119,7 @@ void unbind_evtchn(evtchn_port_t port )if ( rc )printk ("WARN: close_port %d failed rc=%d. ignored\n" , port, rc); } +EXPORT_SYMBOL (unbind_evtchn);evtchn_port_t bind_virq (uint32_t virq,evtchn_handler_t handler,void *data) {
@@ -138,6 +139,7 @@ evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)bind_evtchn (op.port, handler, data);return op.port; } +EXPORT_SYMBOL (bind_virq);evtchn_port_t bind_pirq (uint32_t pirq,int will_share,evtchn_handler_t handler,void *data)
@@ -157,6 +159,7 @@ evtchn_port_t bind_pirq(uint32_t pirq, int will_share,bind_evtchn (op.port, handler, data);return op.port; } +EXPORT_SYMBOL (bind_pirq);/* * Initially all events are without a handler and disabled
@@ -217,6 +220,7 @@ int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler, *port =bind_evtchn (op.port, handler, data);return rc; } +EXPORT_SYMBOL (evtchn_alloc_unbound);/* Connect to a port so as to allow the exchange of notifications with the pal. Returns the result of the hypervisor call. */
@@ -240,6 +244,7 @@ int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port, *local_port =bind_evtchn (port, handler, data);return rc; } +EXPORT_SYMBOL (evtchn_bind_interdomain);int evtchn_get_peercontext (evtchn_port_t local_port,char *ctx,int size) {
@@ -260,6 +265,7 @@ int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size) rc =HYPERVISOR_xsm_op (&op);return rc; } +EXPORT_SYMBOL (evtchn_get_peercontext);/* Replace below when a hypercall is available to get the domid. */ domid_t get_domid (void )
@@ -294,6 +300,7 @@ domid_t get_domid(void)return domid; } +EXPORT_SYMBOL (get_domid);/* * Local variables:
Signature · 1 line
2.35.3
Re: [PATCH v3 16/32] Mini-OS: add EXPORT_SYMBOL() instances to events.c
Juergen Gross, le lun. 27 nov. 2023 11:25:07 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()toevents.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 70 lines
---
V3:
- new patch--- events.c | 7 +++++++ 1 file changed, 7 insertions(+)events.c +7
-0@@ -119,6 +119,7 @@ void unbind_evtchn(evtchn_port_t port )if ( rc )printk ("WARN: close_port %d failed rc=%d. ignored\n" , port, rc); } +EXPORT_SYMBOL (unbind_evtchn);evtchn_port_t bind_virq (uint32_t virq,evtchn_handler_t handler,void *data) {@@ -138,6 +139,7 @@ evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)bind_evtchn (op.port, handler, data);return op.port; } +EXPORT_SYMBOL (bind_virq);evtchn_port_t bind_pirq (uint32_t pirq,int will_share,evtchn_handler_t handler,void *data)@@ -157,6 +159,7 @@ evtchn_port_t bind_pirq(uint32_t pirq, int will_share,bind_evtchn (op.port, handler, data);return op.port; } +EXPORT_SYMBOL (bind_pirq);/* * Initially all events are without a handler and disabled @@ -217,6 +220,7 @@ int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler, *port =bind_evtchn (op.port, handler, data);return rc; } +EXPORT_SYMBOL (evtchn_alloc_unbound);/* Connect to a port so as to allow the exchange of notifications with the pal. Returns the result of the hypervisor call. */ @@ -240,6 +244,7 @@ int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port, *local_port =bind_evtchn (port, handler, data);return rc; } +EXPORT_SYMBOL (evtchn_bind_interdomain);int evtchn_get_peercontext (evtchn_port_t local_port,char *ctx,int size) {@@ -260,6 +265,7 @@ int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size) rc =HYPERVISOR_xsm_op (&op);return rc; } +EXPORT_SYMBOL (evtchn_get_peercontext);/* Replace below when a hypercall is available to get the domid. */ domid_t get_domid (void )@@ -294,6 +300,7 @@ domid_t get_domid(void)return domid; } +EXPORT_SYMBOL (get_domid);/* * Local variables: Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 17/32 Mini-OS: add EXPORT_SYMBOL() instances to gntmap.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to gntmap.c.
---
V3:
- new patch
--- gntmap.c | 5 +++++ 1 file changed, 5 insertions(+)
gntmap.c +5 -0
@@ -106,6 +106,7 @@ gntmap_set_max_grants(struct gntmap *map, int count) map->nentries = count;return 0 ; } +EXPORT_SYMBOL (gntmap_set_max_grants);static int _gntmap_unmap_grant_ref (struct gntmap *map,int idx)
@@ -209,6 +210,7 @@ gntmap_munmap(struct gntmap *map, unsigned long start_address, int count)return 0 ; } +EXPORT_SYMBOL (gntmap_munmap);void * gntmap_map_grant_refs(struct gntmap *map,
@@ -251,6 +253,7 @@ gntmap_map_grant_refs(struct gntmap *map,return (void *) addr; } +EXPORT_SYMBOL (gntmap_map_grant_refs);void gntmap_init (struct gntmap *map)
@@ -259,6 +262,7 @@ gntmap_init(struct gntmap *map) map->nentries =0 ; map->entries =NULL ; } +EXPORT_SYMBOL (gntmap_init);void gntmap_fini (struct gntmap *map)
@@ -281,3 +285,4 @@ gntmap_fini(struct gntmap *map) map->entries =NULL ; map->nentries =0 ; } +EXPORT_SYMBOL (gntmap_fini);
Signature · 1 line
2.35.3
Re: [PATCH v3 17/32] Mini-OS: add EXPORT_SYMBOL() instances to gntmap.c
Juergen Gross, le lun. 27 nov. 2023 11:25:08 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()togntmap.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 51 lines
---
V3:
- new patch--- gntmap.c | 5 +++++ 1 file changed, 5 insertions(+)gntmap.c +5
-0@@ -106,6 +106,7 @@ gntmap_set_max_grants(struct gntmap *map, int count) map->nentries = count;return 0 ; } +EXPORT_SYMBOL (gntmap_set_max_grants);static int _gntmap_unmap_grant_ref (struct gntmap *map,int idx)@@ -209,6 +210,7 @@ gntmap_munmap(struct gntmap *map, unsigned long start_address, int count)return 0 ; } +EXPORT_SYMBOL (gntmap_munmap);void * gntmap_map_grant_refs(struct gntmap *map,@@ -251,6 +253,7 @@ gntmap_map_grant_refs(struct gntmap *map,return (void *) addr; } +EXPORT_SYMBOL (gntmap_map_grant_refs);void gntmap_init (struct gntmap *map)@@ -259,6 +262,7 @@ gntmap_init(struct gntmap *map) map->nentries =0 ; map->entries =NULL ; } +EXPORT_SYMBOL (gntmap_init);void gntmap_fini (struct gntmap *map)@@ -281,3 +285,4 @@ gntmap_fini(struct gntmap *map) map->entries =NULL ; map->nentries =0 ; } +EXPORT_SYMBOL (gntmap_fini);Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 18/32 Mini-OS: add EXPORT_SYMBOL() instances to gnttab.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to gnttab.c.
---
V3:
- new patch
--- gnttab.c | 6 ++++++ 1 file changed, 6 insertions(+)
gnttab.c +6 -0
@@ -80,6 +80,7 @@ gnttab_grant_access(domid_t domid, unsigned long frame, int readonly)return ref; } +EXPORT_SYMBOL (gnttab_grant_access);grant_ref_t gnttab_grant_transfer (domid_t domid,unsigned long pfn)
@@ -94,6 +95,7 @@ gnttab_grant_transfer(domid_t domid, unsigned long pfn)return ref; } +EXPORT_SYMBOL (gnttab_grant_transfer);int gnttab_end_access (grant_ref_t ref)
@@ -114,6 +116,7 @@ gnttab_end_access(grant_ref_t ref)put_free_entry (ref);return 1 ; } +EXPORT_SYMBOL (gnttab_end_access);unsigned long gnttab_end_transfer (grant_ref_t ref)
@@ -144,6 +147,7 @@ gnttab_end_transfer(grant_ref_t ref)return frame; } +EXPORT_SYMBOL (gnttab_end_transfer);grant_ref_t gnttab_alloc_and_grant (void **map)
@@ -156,6 +160,7 @@ gnttab_alloc_and_grant(void **map) gref =gnttab_grant_access (0 , mfn,0 );return gref; } +EXPORT_SYMBOL (gnttab_alloc_and_grant);static const char *const gnttabop_error_msgs[] = GNTTABOP_error_msgs;
@@ -168,6 +173,7 @@ gnttabop_error(int16_t status)else return gnttabop_error_msgs[status]; } +EXPORT_SYMBOL (gnttabop_error);void init_gnttab (void )
Signature · 1 line
2.35.3
Re: [PATCH v3 18/32] Mini-OS: add EXPORT_SYMBOL() instances to gnttab.c
Juergen Gross, le lun. 27 nov. 2023 11:25:09 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tognttab.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 62 lines
---
V3:
- new patch--- gnttab.c | 6 ++++++ 1 file changed, 6 insertions(+)gnttab.c +6
-0@@ -80,6 +80,7 @@ gnttab_grant_access(domid_t domid, unsigned long frame, int readonly)return ref; } +EXPORT_SYMBOL (gnttab_grant_access);grant_ref_t gnttab_grant_transfer (domid_t domid,unsigned long pfn)@@ -94,6 +95,7 @@ gnttab_grant_transfer(domid_t domid, unsigned long pfn)return ref; } +EXPORT_SYMBOL (gnttab_grant_transfer);int gnttab_end_access (grant_ref_t ref)@@ -114,6 +116,7 @@ gnttab_end_access(grant_ref_t ref)put_free_entry (ref);return 1 ; } +EXPORT_SYMBOL (gnttab_end_access);unsigned long gnttab_end_transfer (grant_ref_t ref)@@ -144,6 +147,7 @@ gnttab_end_transfer(grant_ref_t ref)return frame; } +EXPORT_SYMBOL (gnttab_end_transfer);grant_ref_t gnttab_alloc_and_grant (void **map)@@ -156,6 +160,7 @@ gnttab_alloc_and_grant(void **map) gref =gnttab_grant_access (0 , mfn,0 );return gref; } +EXPORT_SYMBOL (gnttab_alloc_and_grant);static const char *const gnttabop_error_msgs[] = GNTTABOP_error_msgs;@@ -168,6 +173,7 @@ gnttabop_error(int16_t status)else return gnttabop_error_msgs[status]; } +EXPORT_SYMBOL (gnttabop_error);void init_gnttab (void )Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 19/32 Mini-OS: add EXPORT_SYMBOL() instances to ioremap.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to ioremap.c.
---
V3:
- new patch
--- arch/x86/ioremap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/ioremap.c +3 -2
@@ -51,11 +51,13 @@ void *ioremap(unsigned long phys_addr, unsigned long size) {return __do_ioremap (phys_addr, size,IO_PROT ); } +EXPORT_SYMBOL (ioremap);void *ioremap_nocache (unsigned long phys_addr,unsigned long size) {return __do_ioremap (phys_addr, size,IO_PROT_NOCACHE ); } +EXPORT_SYMBOL (ioremap_nocache);/* Un-map the io-remapped region. Currently no list of existing mappings is * maintained, so the caller has to supply the size */
@@ -69,7 +71,6 @@ void iounmap(void *virt_addr, unsigned long size)unmap_frames (va &PAGE_MASK , num_pages); } - - +EXPORT_SYMBOL (iounmap);/* -*- Mode:C; c-basic-offset:4; tab-width:4 indent-tabs-mode:nil -*- */
Signature · 1 line
2.35.3
PATCH v3 20/32 Mini-OS: add EXPORT_SYMBOL() instances to lock.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lock.c.
---
V3:
- new patch
--- lock.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
lock.c +8 -1
@@ -17,6 +17,7 @@ int ___lock_init(_LOCK_T *lock)init_waitqueue_head (&lock->wait);return 0 ; } +EXPORT_SYMBOL (___lock_init);int ___lock_acquire (_LOCK_T *lock) {
@@ -32,6 +33,7 @@ int ___lock_acquire(_LOCK_T *lock)local_irq_restore (flags);return 0 ; } +EXPORT_SYMBOL (___lock_acquire);int ___lock_try_acquire (_LOCK_T *lock) {
@@ -45,6 +47,7 @@ int ___lock_try_acquire(_LOCK_T *lock)local_irq_restore (flags);return ret; } +EXPORT_SYMBOL (___lock_try_acquire);int ___lock_release (_LOCK_T *lock) {
@@ -55,7 +58,7 @@ int ___lock_release(_LOCK_T *lock)local_irq_restore (flags);return 0 ; } - +EXPORT_SYMBOL (___lock_release);int ___lock_init_recursive (_LOCK_RECURSIVE_T *lock) {
@@ -63,6 +66,7 @@ int ___lock_init_recursive(_LOCK_RECURSIVE_T *lock)init_waitqueue_head (&lock->wait);return 0 ; } +EXPORT_SYMBOL (___lock_init_recursive);int ___lock_acquire_recursive (_LOCK_RECURSIVE_T *lock) {
@@ -81,6 +85,7 @@ int ___lock_acquire_recursive(_LOCK_RECURSIVE_T *lock) lock->count++;return 0 ; } +EXPORT_SYMBOL (___lock_acquire_recursive);int ___lock_try_acquire_recursive (_LOCK_RECURSIVE_T *lock) {
@@ -95,6 +100,7 @@ int ___lock_try_acquire_recursive(_LOCK_RECURSIVE_T *lock)local_irq_restore (flags);return ret; } +EXPORT_SYMBOL (___lock_try_acquire_recursive);int ___lock_release_recursive (_LOCK_RECURSIVE_T *lock) {
@@ -108,5 +114,6 @@ int ___lock_release_recursive(_LOCK_RECURSIVE_T *lock)local_irq_restore (flags); return 0; } +EXPORT_SYMBOL (___lock_release_recursive);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 20/32] Mini-OS: add EXPORT_SYMBOL() instances to lock.c
Juergen Gross, le lun. 27 nov. 2023 11:25:11 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tolock.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 78 lines
---
V3:
- new patch--- lock.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)lock.c +8
-1@@ -17,6 +17,7 @@ int ___lock_init(_LOCK_T *lock)init_waitqueue_head (&lock->wait);return 0 ; } +EXPORT_SYMBOL (___lock_init);int ___lock_acquire (_LOCK_T *lock) {@@ -32,6 +33,7 @@ int ___lock_acquire(_LOCK_T *lock)local_irq_restore (flags);return 0 ; } +EXPORT_SYMBOL (___lock_acquire);int ___lock_try_acquire (_LOCK_T *lock) {@@ -45,6 +47,7 @@ int ___lock_try_acquire(_LOCK_T *lock)local_irq_restore (flags);return ret; } +EXPORT_SYMBOL (___lock_try_acquire);int ___lock_release (_LOCK_T *lock) {@@ -55,7 +58,7 @@ int ___lock_release(_LOCK_T *lock)local_irq_restore (flags);return 0 ; } - +EXPORT_SYMBOL (___lock_release);int ___lock_init_recursive (_LOCK_RECURSIVE_T *lock) {@@ -63,6 +66,7 @@ int ___lock_init_recursive(_LOCK_RECURSIVE_T *lock)init_waitqueue_head (&lock->wait);return 0 ; } +EXPORT_SYMBOL (___lock_init_recursive);int ___lock_acquire_recursive (_LOCK_RECURSIVE_T *lock) {@@ -81,6 +85,7 @@ int ___lock_acquire_recursive(_LOCK_RECURSIVE_T *lock) lock->count++;return 0 ; } +EXPORT_SYMBOL (___lock_acquire_recursive);int ___lock_try_acquire_recursive (_LOCK_RECURSIVE_T *lock) {@@ -95,6 +100,7 @@ int ___lock_try_acquire_recursive(_LOCK_RECURSIVE_T *lock)local_irq_restore (flags);return ret; } +EXPORT_SYMBOL (___lock_try_acquire_recursive);int ___lock_release_recursive (_LOCK_RECURSIVE_T *lock) {@@ -108,5 +114,6 @@ int ___lock_release_recursive(_LOCK_RECURSIVE_T *lock)local_irq_restore (flags); return 0; } +EXPORT_SYMBOL (___lock_release_recursive);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 21/32 Mini-OS: add EXPORT_SYMBOL() instances to time.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to time.c.
---
V3:
- new patch
--- arch/arm/time.c | 1 + arch/x86/time.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/time.c +1 -0
@@ -83,6 +83,7 @@ int gettimeofday(struct timeval *tv, void *tz)return 0 ; } +EXPORT_SYMBOL (gettimeofday);/* Set the timer and mask. */ void write_timer_ctl (uint32_t value) {
arch/x86/time.c +1 -1
@@ -204,7 +204,7 @@ int gettimeofday(struct timeval *tv, void *tz)return 0 ; } - +EXPORT_SYMBOL (gettimeofday);void block_domain (s_time_t until) {
Signature · 1 line
2.35.3
Re: [PATCH v3 21/32] Mini-OS: add EXPORT_SYMBOL() instances to time.c
Juergen Gross, le lun. 27 nov. 2023 11:25:12 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()totime.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 36 lines
---
V3:
- new patch--- arch/arm/time.c | 1 + arch/x86/time.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)arch/arm/time.c +1
-0@@ -83,6 +83,7 @@ int gettimeofday(struct timeval *tv, void *tz)return 0 ; } +EXPORT_SYMBOL (gettimeofday);/* Set the timer and mask. */ void write_timer_ctl (uint32_t value) {arch/x86/time.c +1
-1@@ -204,7 +204,7 @@ int gettimeofday(struct timeval *tv, void *tz)return 0 ; } - +EXPORT_SYMBOL (gettimeofday);void block_domain (s_time_t until) {Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 22/32 Mini-OS: add EXPORT_SYMBOL() instances to lwip-*.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to lwip-*.c.
Most added symbols are in LWIP, but we can't add the EXPORT_SYMBOL() instances easily there.
---
V3:
- new patch
--- lwip-arch.c | 9 +++++++++ lwip-net.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
lwip-arch.c +9 -0
@@ -12,7 +12,9 @@#include <console.h> #include <xmalloc.h> #include <lwip/sys.h> +#include <lwip/inet.h> #include <stdarg.h> +#include <mini-os/export.h> /* Is called to initialize the sys_arch layer */ void sys_init (void )
@@ -293,3 +295,10 @@ void lwip_die(char *fmt, ...)printk ("\n" );BUG (); } + +EXPORT_SYMBOL (htonl); +EXPORT_SYMBOL (htons); +EXPORT_SYMBOL (inet_aton); +EXPORT_SYMBOL (inet_ntoa); +EXPORT_SYMBOL (ntohl); +EXPORT_SYMBOL (ntohs);
lwip-net.c +1 -1
@@ -250,7 +250,7 @@ void networking_set_addr(struct ip_addr *ipaddr, struct ip_addr *netmask, structnetif_set_netmask (the_interface, netmask);netif_set_gw (the_interface, gw); } - +EXPORT_SYMBOL (networking_set_addr);static void arp_timer (void *arg)
Signature · 1 line
2.35.3
PATCH v3 23/32 Mini-OS: add EXPORT_SYMBOL() instances to 9pfront.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to 9pfront.c.
---
V3:
- new patch
--- 9pfront.c | 2 ++ 1 file changed, 2 insertions(+)
9pfront.c +2 -0
@@ -1243,6 +1243,7 @@ void *init_9pfront(unsigned int id, const char *mnt)free (msg);return NULL ; } +EXPORT_SYMBOL (init_9pfront);void shutdown_9pfront (void *dev) {
@@ -1286,6 +1287,7 @@ void shutdown_9pfront(void *dev)printk ("9pfsfront shutdown %u failed, %s\n" , dev9p->id, reason);free (msg); } +EXPORT_SYMBOL (shutdown_9pfront);static const struct file_ops ops_9pfs = { .name ="9pfs" ,
Signature · 1 line
2.35.3
Re: [PATCH v3 23/32] Mini-OS: add EXPORT_SYMBOL() instances to 9pfront.c
Juergen Gross, le lun. 27 nov. 2023 11:25:14 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()to9pfront.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 30 lines
---
V3:
- new patch--- 9pfront.c | 2 ++ 1 file changed, 2 insertions(+)9pfront.c +2
-0@@ -1243,6 +1243,7 @@ void *init_9pfront(unsigned int id, const char *mnt)free (msg);return NULL ; } +EXPORT_SYMBOL (init_9pfront);void shutdown_9pfront (void *dev) {@@ -1286,6 +1287,7 @@ void shutdown_9pfront(void *dev)printk ("9pfsfront shutdown %u failed, %s\n" , dev9p->id, reason);free (msg); } +EXPORT_SYMBOL (shutdown_9pfront);static const struct file_ops ops_9pfs = { .name ="9pfs" ,Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 24/32 Mini-OS: add EXPORT_SYMBOL() instances to blkfront.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to blkfront.c.
---
V3:
- new patch
--- blkfront.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
blkfront.c +9 -3
@@ -23,9 +23,7 @@/* Note: we really suppose non-preemptive threads. */ DECLARE_WAIT_QUEUE_HEAD (blkfront_queue); - - - +EXPORT_SYMBOL (blkfront_queue);#define BLK_RING_SIZE __RING_SIZE((struct blkif_sring *)0, PAGE_SIZE)#define GRANT_INVALID_REF 0
@@ -243,6 +241,7 @@ error:free_blkfront (dev);return NULL ; } +EXPORT_SYMBOL (init_blkfront);void shutdown_blkfront (struct blkfront_dev *dev) {
@@ -304,6 +303,7 @@ close:if (!err)free_blkfront (dev); } +EXPORT_SYMBOL (shutdown_blkfront);static void blkfront_wait_slot (struct blkfront_dev *dev) {
@@ -386,6 +386,7 @@ void blkfront_aio(struct blkfront_aiocb *aiocbp, int write)if (notify)notify_remote_via_evtchn (dev->evtchn); } +EXPORT_SYMBOL (blkfront_aio);static void blkfront_aio_cb (struct blkfront_aiocb *aiocbp,int ret) {
@@ -417,6 +418,7 @@ void blkfront_io(struct blkfront_aiocb *aiocbp, int write)remove_waiter (w, blkfront_queue);local_irq_restore (flags); } +EXPORT_SYMBOL (blkfront_io);static void blkfront_push_operation (struct blkfront_dev *dev,uint8_t op,uint64_t id) {
@@ -444,6 +446,7 @@ void blkfront_aio_push_operation(struct blkfront_aiocb *aiocbp, uint8_t op)struct blkfront_dev *dev = aiocbp->aio_dev;blkfront_push_operation (dev, op, (uintptr_t ) aiocbp); } +EXPORT_SYMBOL (blkfront_aio_push_operation);void blkfront_sync (struct blkfront_dev *dev) {
@@ -473,6 +476,7 @@ void blkfront_sync(struct blkfront_dev *dev)remove_waiter (w, blkfront_queue);local_irq_restore (flags); } +EXPORT_SYMBOL (blkfront_sync);int blkfront_aio_poll (struct blkfront_dev *dev) {
@@ -557,6 +561,7 @@ moretodo:return nr_consumed; } +EXPORT_SYMBOL (blkfront_aio_poll);#ifdef HAVE_LIBC static int blkfront_posix_rwop(struct file *file, uint8_t *buf, size_t count,
@@ -773,4 +778,5 @@ int blkfront_open(struct blkfront_dev *dev) return dev->fd; } +EXPORT_SYMBOL (blkfront_open);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 24/32] Mini-OS: add EXPORT_SYMBOL() instances to blkfront.c
Juergen Gross, le lun. 27 nov. 2023 11:25:15 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()toblkfront.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 87 lines
---
V3:
- new patch--- blkfront.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)blkfront.c +9
-3@@ -23,9 +23,7 @@/* Note: we really suppose non-preemptive threads. */ DECLARE_WAIT_QUEUE_HEAD (blkfront_queue); - - - +EXPORT_SYMBOL (blkfront_queue);#define BLK_RING_SIZE __RING_SIZE((struct blkif_sring *)0, PAGE_SIZE)#define GRANT_INVALID_REF 0@@ -243,6 +241,7 @@ error:free_blkfront (dev);return NULL ; } +EXPORT_SYMBOL (init_blkfront);void shutdown_blkfront (struct blkfront_dev *dev) {@@ -304,6 +303,7 @@ close:if (!err)free_blkfront (dev); } +EXPORT_SYMBOL (shutdown_blkfront);static void blkfront_wait_slot (struct blkfront_dev *dev) {@@ -386,6 +386,7 @@ void blkfront_aio(struct blkfront_aiocb *aiocbp, int write)if (notify)notify_remote_via_evtchn (dev->evtchn); } +EXPORT_SYMBOL (blkfront_aio);static void blkfront_aio_cb (struct blkfront_aiocb *aiocbp,int ret) {@@ -417,6 +418,7 @@ void blkfront_io(struct blkfront_aiocb *aiocbp, int write)remove_waiter (w, blkfront_queue);local_irq_restore (flags); } +EXPORT_SYMBOL (blkfront_io);static void blkfront_push_operation (struct blkfront_dev *dev,uint8_t op,uint64_t id) {@@ -444,6 +446,7 @@ void blkfront_aio_push_operation(struct blkfront_aiocb *aiocbp, uint8_t op)struct blkfront_dev *dev = aiocbp->aio_dev;blkfront_push_operation (dev, op, (uintptr_t ) aiocbp); } +EXPORT_SYMBOL (blkfront_aio_push_operation);void blkfront_sync (struct blkfront_dev *dev) {@@ -473,6 +476,7 @@ void blkfront_sync(struct blkfront_dev *dev)remove_waiter (w, blkfront_queue);local_irq_restore (flags); } +EXPORT_SYMBOL (blkfront_sync);int blkfront_aio_poll (struct blkfront_dev *dev) {@@ -557,6 +561,7 @@ moretodo:return nr_consumed; } +EXPORT_SYMBOL (blkfront_aio_poll);#ifdef HAVE_LIBC static int blkfront_posix_rwop(struct file *file, uint8_t *buf, size_t count,@@ -773,4 +778,5 @@ int blkfront_open(struct blkfront_dev *dev) return dev->fd; } +EXPORT_SYMBOL (blkfront_open);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 25/32 Mini-OS: add EXPORT_SYMBOL() instances to fbfront.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to fbfront.c.
---
V3:
- new patch
--- fbfront.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
fbfront.c +10 -1
@@ -201,6 +201,7 @@ error:free_kbdfront (dev);return NULL ; } +EXPORT_SYMBOL (init_kbdfront);int kbdfront_receive (struct kbdfront_dev *dev,union xenkbd_in_event *buf,int n) {
@@ -239,7 +240,7 @@ int kbdfront_receive(struct kbdfront_dev *dev, union xenkbd_in_event *buf, int nreturn i; } - +EXPORT_SYMBOL (kbdfront_receive);void shutdown_kbdfront (struct kbdfront_dev *dev) {
@@ -301,6 +302,7 @@ close_kbdfront:if (!err)free_kbdfront (dev); } +EXPORT_SYMBOL (shutdown_kbdfront);#ifdef HAVE_LIBC static int kbd_read (struct file *file,void *buf,size_t nbytes)
@@ -351,6 +353,7 @@ int kbdfront_open(struct kbdfront_dev *dev) return dev->fd; } +EXPORT_SYMBOL (kbdfront_open);#endif
@@ -451,6 +454,7 @@ int fbfront_receive(struct fbfront_dev *dev, union xenfb_in_event *buf, int n)return i; } +EXPORT_SYMBOL (fbfront_receive);struct fbfront_dev *init_fbfront (char *_nodename,unsigned long *mfns,int width,int height,int depth,int stride,int n) {
@@ -617,6 +621,7 @@ error:free_fbfront (dev);return NULL ; } +EXPORT_SYMBOL (init_fbfront);static void fbfront_out_event (struct fbfront_dev *dev,union xenfb_out_event *event) {
@@ -668,6 +673,7 @@ void fbfront_update(struct fbfront_dev *dev, int x, int y, int width, int height update.height = height;fbfront_out_event (dev, (union xenfb_out_event *) &update); } +EXPORT_SYMBOL (fbfront_update);void fbfront_resize (struct fbfront_dev *dev,int width,int height,int stride,int depth,int offset) {
@@ -681,6 +687,7 @@ void fbfront_resize(struct fbfront_dev *dev, int width, int height, int stride, dev->offset = resize.offset = offset;fbfront_out_event (dev, (union xenfb_out_event *) &resize); } +EXPORT_SYMBOL (fbfront_resize);void shutdown_fbfront (struct fbfront_dev *dev) {
@@ -745,6 +752,7 @@ close_fbfront:if (!err)free_fbfront (dev); } +EXPORT_SYMBOL (shutdown_fbfront);#ifdef HAVE_LIBC static int fbfront_read (struct file *file,void *buf,size_t nbytes)
@@ -794,5 +802,6 @@ int fbfront_open(struct fbfront_dev *dev) file->dev = dev; return dev->fd; } +EXPORT_SYMBOL (fbfront_open);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 25/32] Mini-OS: add EXPORT_SYMBOL() instances to fbfront.c
Juergen Gross, le lun. 27 nov. 2023 11:25:16 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()tofbfront.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 94 lines
---
V3:
- new patch--- fbfront.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)fbfront.c +10
-1@@ -201,6 +201,7 @@ error:free_kbdfront (dev);return NULL ; } +EXPORT_SYMBOL (init_kbdfront);int kbdfront_receive (struct kbdfront_dev *dev,union xenkbd_in_event *buf,int n) {@@ -239,7 +240,7 @@ int kbdfront_receive(struct kbdfront_dev *dev, union xenkbd_in_event *buf, int nreturn i; } - +EXPORT_SYMBOL (kbdfront_receive);void shutdown_kbdfront (struct kbdfront_dev *dev) {@@ -301,6 +302,7 @@ close_kbdfront:if (!err)free_kbdfront (dev); } +EXPORT_SYMBOL (shutdown_kbdfront);#ifdef HAVE_LIBC static int kbd_read (struct file *file,void *buf,size_t nbytes)@@ -351,6 +353,7 @@ int kbdfront_open(struct kbdfront_dev *dev) return dev->fd; } +EXPORT_SYMBOL (kbdfront_open);#endif @@ -451,6 +454,7 @@ int fbfront_receive(struct fbfront_dev *dev, union xenfb_in_event *buf, int n)return i; } +EXPORT_SYMBOL (fbfront_receive);struct fbfront_dev *init_fbfront (char *_nodename,unsigned long *mfns,int width,int height,int depth,int stride,int n) {@@ -617,6 +621,7 @@ error:free_fbfront (dev);return NULL ; } +EXPORT_SYMBOL (init_fbfront);static void fbfront_out_event (struct fbfront_dev *dev,union xenfb_out_event *event) {@@ -668,6 +673,7 @@ void fbfront_update(struct fbfront_dev *dev, int x, int y, int width, int height update.height = height;fbfront_out_event (dev, (union xenfb_out_event *) &update); } +EXPORT_SYMBOL (fbfront_update);void fbfront_resize (struct fbfront_dev *dev,int width,int height,int stride,int depth,int offset) {@@ -681,6 +687,7 @@ void fbfront_resize(struct fbfront_dev *dev, int width, int height, int stride, dev->offset = resize.offset = offset;fbfront_out_event (dev, (union xenfb_out_event *) &resize); } +EXPORT_SYMBOL (fbfront_resize);void shutdown_fbfront (struct fbfront_dev *dev) {@@ -745,6 +752,7 @@ close_fbfront:if (!err)free_fbfront (dev); } +EXPORT_SYMBOL (shutdown_fbfront);#ifdef HAVE_LIBC static int fbfront_read (struct file *file,void *buf,size_t nbytes)@@ -794,5 +802,6 @@ int fbfront_open(struct fbfront_dev *dev) file->dev = dev; return dev->fd; } +EXPORT_SYMBOL (fbfront_open);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 26/32 Mini-OS: add EXPORT_SYMBOL() instances to netfront.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to netfront.c.
---
V3:
- new patch
--- netfront.c | 7 +++++++ 1 file changed, 7 insertions(+)
netfront.c +7 -0
@@ -370,16 +370,19 @@ out: err:return dev; } +EXPORT_SYMBOL (init_netfront);char *netfront_get_netmask (struct netfront_dev *dev) {return dev->mask ?strdup (dev->mask) :NULL ; } +EXPORT_SYMBOL (netfront_get_netmask);char *netfront_get_gateway (struct netfront_dev *dev) {return dev->gw ?strdup (dev->gw) :NULL ; } +EXPORT_SYMBOL (netfront_get_gateway);static struct netfront_dev *_init_netfront (struct netfront_dev *dev) {
@@ -625,6 +628,7 @@ int netfront_tap_open(char *nodename) { file->dev = dev; return dev->fd; } +EXPORT_SYMBOL (netfront_tap_open);#endif void shutdown_netfront (struct netfront_dev *dev)
@@ -654,6 +658,7 @@ void shutdown_netfront(struct netfront_dev *dev)free_netfront (dev); } } +EXPORT_SYMBOL (shutdown_netfront);static int _shutdown_netfront (struct netfront_dev *dev) {
@@ -813,6 +818,7 @@ void netfront_xmit(struct netfront_dev *dev, const unsigned char *data, int len)network_tx_buf_gc (dev);local_irq_restore (flags); } +EXPORT_SYMBOL (netfront_xmit);#ifdef HAVE_LIBC ssize_t netfront_receive (struct netfront_dev *dev,unsigned char *data,size_t len)
@@ -840,6 +846,7 @@ ssize_t netfront_receive(struct netfront_dev *dev, unsigned char *data, size_t lreturn dev->rlen; } +EXPORT_SYMBOL (netfront_receive);#endif void netfront_set_rx_handler(struct netfront_dev *dev,
Signature · 1 line
2.35.3
PATCH v3 27/32 Mini-OS: add EXPORT_SYMBOL() instances to pcifront.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to pcifront.c.
---
V3:
- new patch
--- pcifront.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
pcifront.c +10 -1
@@ -278,6 +278,7 @@ error:free_pcifront (dev);return NULL ; } +EXPORT_SYMBOL (init_pcifront);void pcifront_scan (struct pcifront_dev *dev,void (*func)(unsigned int domain,unsigned int bus,unsigned slot,unsigned int fun)) {
@@ -319,6 +320,7 @@ void pcifront_scan(struct pcifront_dev *dev, void (*func)(unsigned int domain, u }free (path); } +EXPORT_SYMBOL (pcifront_scan);void shutdown_pcifront (struct pcifront_dev *dev) {
@@ -377,6 +379,7 @@ close_pcifront:if (!err)free_pcifront (dev); } +EXPORT_SYMBOL (shutdown_pcifront); int pcifront_physical_to_virtual (struct pcifront_dev *dev, unsigned int *dom,
@@ -451,6 +454,7 @@ void pcifront_op(struct pcifront_dev *dev, struct xen_pci_op *op)rmb (); *op = dev->info->op; } +EXPORT_SYMBOL (pcifront_op); int pcifront_conf_read(struct pcifront_dev *dev, unsigned int dom,
@@ -481,6 +485,7 @@ int pcifront_conf_read(struct pcifront_dev *dev,return 0 ; } +EXPORT_SYMBOL (pcifront_conf_read); int pcifront_conf_write(struct pcifront_dev *dev, unsigned int dom,
@@ -508,6 +513,7 @@ int pcifront_conf_write(struct pcifront_dev *dev,return op.err; } +EXPORT_SYMBOL (pcifront_conf_write); int pcifront_enable_msi(struct pcifront_dev *dev, unsigned int dom,
@@ -533,6 +539,7 @@ int pcifront_enable_msi(struct pcifront_dev *dev,else return op.value; } +EXPORT_SYMBOL (pcifront_enable_msi); int pcifront_disable_msi(struct pcifront_dev *dev, unsigned int dom,
@@ -555,6 +562,7 @@ int pcifront_disable_msi(struct pcifront_dev *dev,return op.err; } +EXPORT_SYMBOL (pcifront_disable_msi); int pcifront_enable_msix(struct pcifront_dev *dev, unsigned int dom,
@@ -589,7 +597,7 @@ int pcifront_enable_msix(struct pcifront_dev *dev,return 0 ; } - +EXPORT_SYMBOL (pcifront_enable_msix); int pcifront_disable_msix(struct pcifront_dev *dev, unsigned int dom,
@@ -612,3 +620,4 @@ int pcifront_disable_msix(struct pcifront_dev *dev,return op.err; } +EXPORT_SYMBOL (pcifront_disable_msix);
Signature · 1 line
2.35.3
Re: [PATCH v3 27/32] Mini-OS: add EXPORT_SYMBOL() instances to pcifront.c
Juergen Gross, le lun. 27 nov. 2023 11:25:18 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()topcifront.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 92 lines
---
V3:
- new patch--- pcifront.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)pcifront.c +10
-1@@ -278,6 +278,7 @@ error:free_pcifront (dev);return NULL ; } +EXPORT_SYMBOL (init_pcifront);void pcifront_scan (struct pcifront_dev *dev,void (*func)(unsigned int domain,unsigned int bus,unsigned slot,unsigned int fun)) {@@ -319,6 +320,7 @@ void pcifront_scan(struct pcifront_dev *dev, void (*func)(unsigned int domain, u }free (path); } +EXPORT_SYMBOL (pcifront_scan);void shutdown_pcifront (struct pcifront_dev *dev) {@@ -377,6 +379,7 @@ close_pcifront:if (!err)free_pcifront (dev); } +EXPORT_SYMBOL (shutdown_pcifront); int pcifront_physical_to_virtual (struct pcifront_dev *dev, unsigned int *dom,@@ -451,6 +454,7 @@ void pcifront_op(struct pcifront_dev *dev, struct xen_pci_op *op)rmb (); *op = dev->info->op; } +EXPORT_SYMBOL (pcifront_op); int pcifront_conf_read(struct pcifront_dev *dev, unsigned int dom,@@ -481,6 +485,7 @@ int pcifront_conf_read(struct pcifront_dev *dev,return 0 ; } +EXPORT_SYMBOL (pcifront_conf_read); int pcifront_conf_write(struct pcifront_dev *dev, unsigned int dom,@@ -508,6 +513,7 @@ int pcifront_conf_write(struct pcifront_dev *dev,return op.err; } +EXPORT_SYMBOL (pcifront_conf_write); int pcifront_enable_msi(struct pcifront_dev *dev, unsigned int dom,@@ -533,6 +539,7 @@ int pcifront_enable_msi(struct pcifront_dev *dev,else return op.value; } +EXPORT_SYMBOL (pcifront_enable_msi); int pcifront_disable_msi(struct pcifront_dev *dev, unsigned int dom,@@ -555,6 +562,7 @@ int pcifront_disable_msi(struct pcifront_dev *dev,return op.err; } +EXPORT_SYMBOL (pcifront_disable_msi); int pcifront_enable_msix(struct pcifront_dev *dev, unsigned int dom,@@ -589,7 +597,7 @@ int pcifront_enable_msix(struct pcifront_dev *dev,return 0 ; } - +EXPORT_SYMBOL (pcifront_enable_msix); int pcifront_disable_msix(struct pcifront_dev *dev, unsigned int dom,@@ -612,3 +620,4 @@ int pcifront_disable_msix(struct pcifront_dev *dev,return op.err; } +EXPORT_SYMBOL (pcifront_disable_msix);Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 28/32 Mini-OS: add EXPORT_SYMBOL() instances to tpmback.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to tpmback.c.
---
V3:
- new patch
--- tpmback.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
tpmback.c +11 -0
@@ -804,6 +804,7 @@ void* tpmback_get_opaque(domid_t domid, unsigned int handle)return tpmif->opaque; } +EXPORT_SYMBOL (tpmback_get_opaque);int tpmback_set_opaque (domid_t domid,unsigned int handle,void *opaque) {
@@ -816,6 +817,7 @@ int tpmback_set_opaque(domid_t domid, unsigned int handle, void *opaque) tpmif->opaque = opaque;return 0 ; } +EXPORT_SYMBOL (tpmback_set_opaque);unsigned char *tpmback_get_uuid (domid_t domid,unsigned int handle) {
@@ -827,6 +829,7 @@ unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)return tpmif->uuid; } +EXPORT_SYMBOL (tpmback_get_uuid);int tpmback_get_peercontext (domid_t domid,unsigned int handle,void * buffer,int buflen) {
@@ -838,6 +841,7 @@ int tpmback_get_peercontext(domid_t domid, unsigned int handle, void* buffer, inreturn evtchn_get_peercontext (tpmif->evtchn, buffer, buflen); } +EXPORT_SYMBOL (tpmback_get_peercontext);static void event_listener (void ) {
@@ -903,6 +907,7 @@ void init_tpmback(void (*open_cb)(domid_t, unsigned int), void (*close_cb)(domid eventthread =create_thread ("tpmback-listener" , event_thread,NULL ); } +EXPORT_SYMBOL (init_tpmback);void shutdown_tpmback (void ) {
@@ -923,6 +928,7 @@ void shutdown_tpmback(void)wake_up (&waitq);schedule (); } +EXPORT_SYMBOL (shutdown_tpmback);static void init_tpmcmd (tpmcmd_t * tpmcmd,domid_t domid,unsigned int handle,void *opaque) {
@@ -1061,6 +1067,7 @@ tpmcmd_t* tpmback_req_any(void)TPMBACK_ERR ("backend request ready flag was set but no interfaces were actually ready\n" );return NULL ; } +EXPORT_SYMBOL (tpmback_req_any);tpmcmd_t *tpmback_req (domid_t domid,unsigned int handle) {
@@ -1081,6 +1088,7 @@ tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle)return get_request (tpmif); } +EXPORT_SYMBOL (tpmback_req);void tpmback_resp (tpmcmd_t * tpmcmd) {
@@ -1108,6 +1116,7 @@ end:free (tpmcmd);return ; } +EXPORT_SYMBOL (tpmback_resp);int tpmback_wait_for_frontend_connect (domid_t *domid,unsigned int *handle) {
@@ -1125,8 +1134,10 @@ int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned int *handle)return 0 ; } +EXPORT_SYMBOL (tpmback_wait_for_frontend_connect);int tpmback_num_frontends (void ) {return gtpmdev.num_tpms; } +EXPORT_SYMBOL (tpmback_num_frontends);
Signature · 1 line
2.35.3
Re: [PATCH v3 28/32] Mini-OS: add EXPORT_SYMBOL() instances to tpmback.c
Juergen Gross, le lun. 27 nov. 2023 11:25:19 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()totpmback.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 97 lines
---
V3:
- new patch--- tpmback.c | 11 +++++++++++ 1 file changed, 11 insertions(+)tpmback.c +11
-0@@ -804,6 +804,7 @@ void* tpmback_get_opaque(domid_t domid, unsigned int handle)return tpmif->opaque; } +EXPORT_SYMBOL (tpmback_get_opaque);int tpmback_set_opaque (domid_t domid,unsigned int handle,void *opaque) {@@ -816,6 +817,7 @@ int tpmback_set_opaque(domid_t domid, unsigned int handle, void *opaque) tpmif->opaque = opaque;return 0 ; } +EXPORT_SYMBOL (tpmback_set_opaque);unsigned char *tpmback_get_uuid (domid_t domid,unsigned int handle) {@@ -827,6 +829,7 @@ unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)return tpmif->uuid; } +EXPORT_SYMBOL (tpmback_get_uuid);int tpmback_get_peercontext (domid_t domid,unsigned int handle,void * buffer,int buflen) {@@ -838,6 +841,7 @@ int tpmback_get_peercontext(domid_t domid, unsigned int handle, void* buffer, inreturn evtchn_get_peercontext (tpmif->evtchn, buffer, buflen); } +EXPORT_SYMBOL (tpmback_get_peercontext);static void event_listener (void ) {@@ -903,6 +907,7 @@ void init_tpmback(void (*open_cb)(domid_t, unsigned int), void (*close_cb)(domid eventthread =create_thread ("tpmback-listener" , event_thread,NULL ); } +EXPORT_SYMBOL (init_tpmback);void shutdown_tpmback (void ) {@@ -923,6 +928,7 @@ void shutdown_tpmback(void)wake_up (&waitq);schedule (); } +EXPORT_SYMBOL (shutdown_tpmback);static void init_tpmcmd (tpmcmd_t * tpmcmd,domid_t domid,unsigned int handle,void *opaque) {@@ -1061,6 +1067,7 @@ tpmcmd_t* tpmback_req_any(void)TPMBACK_ERR ("backend request ready flag was set but no interfaces were actually ready\n" );return NULL ; } +EXPORT_SYMBOL (tpmback_req_any);tpmcmd_t *tpmback_req (domid_t domid,unsigned int handle) {@@ -1081,6 +1088,7 @@ tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle)return get_request (tpmif); } +EXPORT_SYMBOL (tpmback_req);void tpmback_resp (tpmcmd_t * tpmcmd) {@@ -1108,6 +1116,7 @@ end:free (tpmcmd);return ; } +EXPORT_SYMBOL (tpmback_resp);int tpmback_wait_for_frontend_connect (domid_t *domid,unsigned int *handle) {@@ -1125,8 +1134,10 @@ int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned int *handle)return 0 ; } +EXPORT_SYMBOL (tpmback_wait_for_frontend_connect);int tpmback_num_frontends (void ) {return gtpmdev.num_tpms; } +EXPORT_SYMBOL (tpmback_num_frontends);Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 29/32 Mini-OS: add EXPORT_SYMBOL() instances to tpmfront.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to tpmfront.c.
---
V3:
- new patch
--- tpmfront.c | 6 ++++++ 1 file changed, 6 insertions(+)
tpmfront.c +6 -0
@@ -338,6 +338,8 @@ error:shutdown_tpmfront (dev);return NULL ; } +EXPORT_SYMBOL (init_tpmfront); +void shutdown_tpmfront (struct tpmfront_dev * dev) {char * err;
@@ -402,6 +404,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev) }free (dev); } +EXPORT_SYMBOL (shutdown_tpmfront);int tpmfront_send (struct tpmfront_dev * dev,const uint8_t * msg,size_t length) {
@@ -528,6 +531,7 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*return 0 ; } +EXPORT_SYMBOL (tpmfront_cmd);int tpmfront_set_locality (struct tpmfront_dev * dev,int locality) {
@@ -536,6 +540,7 @@ int tpmfront_set_locality(struct tpmfront_dev* dev, int locality) dev->page->locality = locality;return 0 ; } +EXPORT_SYMBOL (tpmfront_set_locality);#ifdef HAVE_LIBC #include <errno.h>
@@ -663,5 +668,6 @@ int tpmfront_open(struct tpmfront_dev *dev) return dev->fd; } +EXPORT_SYMBOL (tpmfront_open);#endif
Signature · 1 line
2.35.3
Re: [PATCH v3 29/32] Mini-OS: add EXPORT_SYMBOL() instances to tpmfront.c
Juergen Gross, le lun. 27 nov. 2023 11:25:20 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()totpmfront.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 54 lines
---
V3:
- new patch--- tpmfront.c | 6 ++++++ 1 file changed, 6 insertions(+)tpmfront.c +6
-0@@ -338,6 +338,8 @@ error:shutdown_tpmfront (dev);return NULL ; } +EXPORT_SYMBOL (init_tpmfront); +void shutdown_tpmfront (struct tpmfront_dev * dev) {char * err;@@ -402,6 +404,7 @@ void shutdown_tpmfront(struct tpmfront_dev* dev) }free (dev); } +EXPORT_SYMBOL (shutdown_tpmfront);int tpmfront_send (struct tpmfront_dev * dev,const uint8_t * msg,size_t length) {@@ -528,6 +531,7 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*return 0 ; } +EXPORT_SYMBOL (tpmfront_cmd);int tpmfront_set_locality (struct tpmfront_dev * dev,int locality) {@@ -536,6 +540,7 @@ int tpmfront_set_locality(struct tpmfront_dev* dev, int locality) dev->page->locality = locality;return 0 ; } +EXPORT_SYMBOL (tpmfront_set_locality);#ifdef HAVE_LIBC #include <errno.h> @@ -663,5 +668,6 @@ int tpmfront_open(struct tpmfront_dev *dev) return dev->fd; } +EXPORT_SYMBOL (tpmfront_open);#endif Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 30/32 Mini-OS: add EXPORT_SYMBOL() instances to tpm_tis.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to tpm_tis.c.
---
V3:
- new patch
--- tpm_tis.c | 5 +++++ 1 file changed, 5 insertions(+)
tpm_tis.c +5 -0
@@ -673,6 +673,7 @@ int tpm_tis_request_locality(struct tpm_chip* tpm, int l) {printk ("REQ LOCALITY FAILURE\n" );return -1 ; } +EXPORT_SYMBOL (tpm_tis_request_locality);static uint8_t tpm_tis_status (struct tpm_chip * tpm) {return ioread8 (TPM_STS (tpm, tpm->locality));
@@ -1264,6 +1265,7 @@ abort_egress: }return NULL ; } +EXPORT_SYMBOL (init_tpm_tis);int tpm_tis_cmd (struct tpm_chip * tpm,uint8_t * req,size_t reqlen,uint8_t ** resp,size_t * resplen) {
@@ -1281,6 +1283,7 @@ int tpm_tis_cmd(struct tpm_chip* tpm, uint8_t* req, size_t reqlen, uint8_t** resmemcpy (*resp, tpm->data_buffer, *resplen);return 0 ; } +EXPORT_SYMBOL (tpm_tis_cmd);#ifdef HAVE_LIBC #include <sys/stat.h>
@@ -1392,6 +1395,7 @@ int tpm_tis_open(struct tpm_chip *tpm)return tpm->fd; } +EXPORT_SYMBOL (tpm_tis_open);/* TPM 2.0 */
@@ -1550,4 +1554,5 @@ abort_egress: }return NULL ; } +EXPORT_SYMBOL (init_tpm2_tis);#endif
Signature · 1 line
2.35.3
PATCH v3 31/32 Mini-OS: add EXPORT_SYMBOL() instances to xenbus.c
In reply to Juergen GrossAdd the needed instances of EXPORT_SYMBOL() to xenbus.c.
---
V3:
- new patch
--- xenbus.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
xenbus.c +23 -0
@@ -123,6 +123,7 @@ char **xenbus_wait_for_watch_return(xenbus_event_queue *queue)return &event->path; } +EXPORT_SYMBOL (xenbus_wait_for_watch_return);void xenbus_wait_for_watch (xenbus_event_queue *queue) {
@@ -136,6 +137,7 @@ void xenbus_wait_for_watch(xenbus_event_queue *queue)else printk ("unexpected path returned by watch\n" ); } +EXPORT_SYMBOL (xenbus_wait_for_watch);void xenbus_release_wait_for_watch (xenbus_event_queue *queue) {
@@ -145,6 +147,7 @@ void xenbus_release_wait_for_watch(xenbus_event_queue *queue) *queue = event;wake_up (&xenbus_watch_queue); } +EXPORT_SYMBOL (xenbus_release_wait_for_watch);char *xenbus_wait_for_value (const char *path,const char *value,xenbus_event_queue *queue)
@@ -170,6 +173,7 @@ char *xenbus_wait_for_value(const char *path, const char *value,xenbus_wait_for_watch (queue); } } +EXPORT_SYMBOL (xenbus_wait_for_value);char *xenbus_switch_state (xenbus_transaction_t xbt,const char *path,XenbusState state)
@@ -220,6 +224,7 @@ exit:return msg; } +EXPORT_SYMBOL (xenbus_switch_state);char *xenbus_wait_for_state_change (const char *path,XenbusState *state,xenbus_event_queue *queue)
@@ -249,6 +254,7 @@ char *xenbus_wait_for_state_change(const char *path, XenbusState *state, }return NULL ; } +EXPORT_SYMBOL (xenbus_wait_for_state_change);static void xenbus_read_data (char *buf,unsigned int len) {
@@ -602,6 +608,7 @@ struct xsd_sockmsg *xenbus_msg_reply(int type, xenbus_transaction_t trans,return rep; } +EXPORT_SYMBOL (xenbus_msg_reply);static char *errmsg (struct xsd_sockmsg *rep) {
@@ -664,6 +671,7 @@ char *xenbus_ls(xenbus_transaction_t xbt, const char *pre, char ***contents)return NULL ; } +EXPORT_SYMBOL (xenbus_ls);char *xenbus_read (xenbus_transaction_t xbt,const char *path,char **value) {
@@ -687,6 +695,7 @@ char *xenbus_read(xenbus_transaction_t xbt, const char *path, char **value)return NULL ; } +EXPORT_SYMBOL (xenbus_read);char *xenbus_write (xenbus_transaction_t xbt,const char *path,const char *value)
@@ -707,6 +716,7 @@ char *xenbus_write(xenbus_transaction_t xbt, const char *path,return NULL ; } +EXPORT_SYMBOL (xenbus_write);char *xenbus_watch_path_token (xenbus_transaction_t xbt,const char *path,const char *token,xenbus_event_queue *events)
@@ -738,6 +748,7 @@ char* xenbus_watch_path_token(xenbus_transaction_t xbt, const char *path,return NULL ; } +EXPORT_SYMBOL (xenbus_watch_path_token);char *xenbus_unwatch_path_token (xenbus_transaction_t xbt,const char *path,const char *token)
@@ -771,6 +782,7 @@ char* xenbus_unwatch_path_token(xenbus_transaction_t xbt, const char *path,return NULL ; } +EXPORT_SYMBOL (xenbus_unwatch_path_token);char *xenbus_rm (xenbus_transaction_t xbt,const char *path) {
@@ -787,6 +799,7 @@ char *xenbus_rm(xenbus_transaction_t xbt, const char *path)return NULL ; } +EXPORT_SYMBOL (xenbus_rm);char *xenbus_get_perms (xenbus_transaction_t xbt,const char *path,char **value) {
@@ -810,6 +823,7 @@ char *xenbus_get_perms(xenbus_transaction_t xbt, const char *path, char **value)return NULL ; } +EXPORT_SYMBOL (xenbus_get_perms);#define PERM_MAX_SIZE 32 char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom,
@@ -834,6 +848,7 @@ char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom,return NULL ; } +EXPORT_SYMBOL (xenbus_set_perms);char *xenbus_transaction_start (xenbus_transaction_t *xbt) {
@@ -855,6 +870,7 @@ char *xenbus_transaction_start(xenbus_transaction_t *xbt)return NULL ; } +EXPORT_SYMBOL (xenbus_transaction_start);char *xenbus_transaction_end (xenbus_transaction_t t,int abort,int *retry) {
@@ -883,6 +899,7 @@ char *xenbus_transaction_end(xenbus_transaction_t t, int abort, int *retry)return NULL ; } +EXPORT_SYMBOL (xenbus_transaction_end);int xenbus_read_integer (const char *path) {
@@ -902,6 +919,7 @@ int xenbus_read_integer(const char *path)return t; } +EXPORT_SYMBOL (xenbus_read_integer);int xenbus_read_uuid (const char *path,unsigned char uuid[16 ]) {
@@ -935,6 +953,7 @@ int xenbus_read_uuid(const char *path, unsigned char uuid[16])return 1 ; } +EXPORT_SYMBOL (xenbus_read_uuid);#define BUFFER_SIZE 256static void xenbus_build_path (const char *dir,const char *node,char *res)
@@ -957,6 +976,7 @@ char *xenbus_printf(xenbus_transaction_t xbt, const char* node,return xenbus_write (xbt,fullpath,val); } +EXPORT_SYMBOL (xenbus_printf);domid_t xenbus_get_self_id (void ) {
@@ -968,6 +988,7 @@ domid_t xenbus_get_self_id(void)return ret; } +EXPORT_SYMBOL (xenbus_get_self_id);char *xenbus_read_string (xenbus_transaction_t xbt,const char *dir,const char *node,char **value)
@@ -978,6 +999,7 @@ char *xenbus_read_string(xenbus_transaction_t xbt, const char *dir,return xenbus_read (xbt, path, value); } +EXPORT_SYMBOL (xenbus_read_string);char *xenbus_read_unsigned (xenbus_transaction_t xbt,const char *dir,const char *node,unsigned int *value)
@@ -997,6 +1019,7 @@ char *xenbus_read_unsigned(xenbus_transaction_t xbt, const char *dir,return msg; } +EXPORT_SYMBOL (xenbus_read_unsigned);/* * Local variables:
Signature · 1 line
2.35.3
Re: [PATCH v3 31/32] Mini-OS: add EXPORT_SYMBOL() instances to xenbus.c
Juergen Gross, le lun. 27 nov. 2023 11:25:22 +0100, a ecrit:
Quoted 3 lines
Add the needed instances of
EXPORT_SYMBOL()toxenbus.c.Signed-off-by Juergen Gross <[email protected]>
Quoted 198 lines
---
V3:
- new patch--- xenbus.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)xenbus.c +23
-0@@ -123,6 +123,7 @@ char **xenbus_wait_for_watch_return(xenbus_event_queue *queue)return &event->path; } +EXPORT_SYMBOL (xenbus_wait_for_watch_return);void xenbus_wait_for_watch (xenbus_event_queue *queue) {@@ -136,6 +137,7 @@ void xenbus_wait_for_watch(xenbus_event_queue *queue)else printk ("unexpected path returned by watch\n" ); } +EXPORT_SYMBOL (xenbus_wait_for_watch);void xenbus_release_wait_for_watch (xenbus_event_queue *queue) {@@ -145,6 +147,7 @@ void xenbus_release_wait_for_watch(xenbus_event_queue *queue) *queue = event;wake_up (&xenbus_watch_queue); } +EXPORT_SYMBOL (xenbus_release_wait_for_watch);char *xenbus_wait_for_value (const char *path,const char *value,xenbus_event_queue *queue)@@ -170,6 +173,7 @@ char *xenbus_wait_for_value(const char *path, const char *value,xenbus_wait_for_watch (queue); } } +EXPORT_SYMBOL (xenbus_wait_for_value);char *xenbus_switch_state (xenbus_transaction_t xbt,const char *path,XenbusState state)@@ -220,6 +224,7 @@ exit:return msg; } +EXPORT_SYMBOL (xenbus_switch_state);char *xenbus_wait_for_state_change (const char *path,XenbusState *state,xenbus_event_queue *queue)@@ -249,6 +254,7 @@ char *xenbus_wait_for_state_change(const char *path, XenbusState *state, }return NULL ; } +EXPORT_SYMBOL (xenbus_wait_for_state_change);static void xenbus_read_data (char *buf,unsigned int len) {@@ -602,6 +608,7 @@ struct xsd_sockmsg *xenbus_msg_reply(int type, xenbus_transaction_t trans,return rep; } +EXPORT_SYMBOL (xenbus_msg_reply);static char *errmsg (struct xsd_sockmsg *rep) {@@ -664,6 +671,7 @@ char *xenbus_ls(xenbus_transaction_t xbt, const char *pre, char ***contents)return NULL ; } +EXPORT_SYMBOL (xenbus_ls);char *xenbus_read (xenbus_transaction_t xbt,const char *path,char **value) {@@ -687,6 +695,7 @@ char *xenbus_read(xenbus_transaction_t xbt, const char *path, char **value)return NULL ; } +EXPORT_SYMBOL (xenbus_read);char *xenbus_write (xenbus_transaction_t xbt,const char *path,const char *value)@@ -707,6 +716,7 @@ char *xenbus_write(xenbus_transaction_t xbt, const char *path,return NULL ; } +EXPORT_SYMBOL (xenbus_write);char *xenbus_watch_path_token (xenbus_transaction_t xbt,const char *path,const char *token,xenbus_event_queue *events)@@ -738,6 +748,7 @@ char* xenbus_watch_path_token(xenbus_transaction_t xbt, const char *path,return NULL ; } +EXPORT_SYMBOL (xenbus_watch_path_token);char *xenbus_unwatch_path_token (xenbus_transaction_t xbt,const char *path,const char *token)@@ -771,6 +782,7 @@ char* xenbus_unwatch_path_token(xenbus_transaction_t xbt, const char *path,return NULL ; } +EXPORT_SYMBOL (xenbus_unwatch_path_token);char *xenbus_rm (xenbus_transaction_t xbt,const char *path) {@@ -787,6 +799,7 @@ char *xenbus_rm(xenbus_transaction_t xbt, const char *path)return NULL ; } +EXPORT_SYMBOL (xenbus_rm);char *xenbus_get_perms (xenbus_transaction_t xbt,const char *path,char **value) {@@ -810,6 +823,7 @@ char *xenbus_get_perms(xenbus_transaction_t xbt, const char *path, char **value)return NULL ; } +EXPORT_SYMBOL (xenbus_get_perms);#define PERM_MAX_SIZE 32 char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom,@@ -834,6 +848,7 @@ char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom,return NULL ; } +EXPORT_SYMBOL (xenbus_set_perms);char *xenbus_transaction_start (xenbus_transaction_t *xbt) {@@ -855,6 +870,7 @@ char *xenbus_transaction_start(xenbus_transaction_t *xbt)return NULL ; } +EXPORT_SYMBOL (xenbus_transaction_start);char *xenbus_transaction_end (xenbus_transaction_t t,int abort,int *retry) {@@ -883,6 +899,7 @@ char *xenbus_transaction_end(xenbus_transaction_t t, int abort, int *retry)return NULL ; } +EXPORT_SYMBOL (xenbus_transaction_end);int xenbus_read_integer (const char *path) {@@ -902,6 +919,7 @@ int xenbus_read_integer(const char *path)return t; } +EXPORT_SYMBOL (xenbus_read_integer);int xenbus_read_uuid (const char *path,unsigned char uuid[16 ]) {@@ -935,6 +953,7 @@ int xenbus_read_uuid(const char *path, unsigned char uuid[16])return 1 ; } +EXPORT_SYMBOL (xenbus_read_uuid);#define BUFFER_SIZE 256static void xenbus_build_path (const char *dir,const char *node,char *res)@@ -957,6 +976,7 @@ char *xenbus_printf(xenbus_transaction_t xbt, const char* node,return xenbus_write (xbt,fullpath,val); } +EXPORT_SYMBOL (xenbus_printf);domid_t xenbus_get_self_id (void ) {@@ -968,6 +988,7 @@ domid_t xenbus_get_self_id(void)return ret; } +EXPORT_SYMBOL (xenbus_get_self_id);char *xenbus_read_string (xenbus_transaction_t xbt,const char *dir,const char *node,char **value)@@ -978,6 +999,7 @@ char *xenbus_read_string(xenbus_transaction_t xbt, const char *dir,return xenbus_read (xbt, path, value); } +EXPORT_SYMBOL (xenbus_read_string);char *xenbus_read_unsigned (xenbus_transaction_t xbt,const char *dir,const char *node,unsigned int *value)@@ -997,6 +1019,7 @@ char *xenbus_read_unsigned(xenbus_transaction_t xbt, const char *dir,return msg; } +EXPORT_SYMBOL (xenbus_read_unsigned);/* * Local variables: Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
PATCH v3 32/32 Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()
In reply to Juergen GrossWhen doing the final linking of the Mini-OS kernel only keep the symbols visible which have been marked via EXPORT_SYMBOL().
---
V3:
- new patch
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -167,6 +167,7 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S $(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@ $(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@ + $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* --keep-global-symbols=$(OBJ_DIR)/syms --remove-section=.export_symbol $@ $@ $(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o [email protected]
Signature · 1 line
2.35.3
Re: [PATCH v3 32/32] Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()
Juergen Gross, le lun. 27 nov. 2023 11:25:23 +0100, a ecrit:
Quoted 4 lines
When doing the final linking of the Mini-OS kernel only keep the symbols visible which have been marked via
EXPORT_SYMBOL().Signed-off-by Juergen Gross <[email protected]>
Quoted 22 lines
---
V3:
- new patch--- Makefile | 1 + 1 file changed, 1 insertion(+)Makefile +1
-0@@ -167,6 +167,7 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S $(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@ $(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@ + $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* --keep-global-symbols=$(OBJ_DIR)/syms --remove-section=.export_symbol $@ $@ $(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o [email protected]Signature · 1 line
2.35.3
Signature · 4 lines
Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.
Hello,
Juergen Gross, le lun. 27 nov. 2023 11:24:51 +0100, a ecrit:
Quoted 4 lines
Mini-OS: add
EXPORT_SYMBOL()instances toioremap.c
Mini-OS: addEXPORT_SYMBOL()instances to lwip-*.c
Mini-OS: addEXPORT_SYMBOL()instances tonetfront.c
Mini-OS: addEXPORT_SYMBOL()instances totpm_tis.c
I didn't receive the mails for those, but I went to the list archive, and here it is for them:
Samuel