From db6592b31877034b911fe070b346b7ef47ddbf91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 17 Jul 2012 14:48:19 +0200 Subject: os_mon: Remove VxWorks --- lib/os_mon/c_src/Makefile.in | 8 ----- lib/os_mon/c_src/memsup.c | 71 ++------------------------------------------ lib/os_mon/src/memsup.erl | 4 +-- lib/os_mon/src/os_mon.erl | 2 -- 4 files changed, 4 insertions(+), 81 deletions(-) (limited to 'lib') diff --git a/lib/os_mon/c_src/Makefile.in b/lib/os_mon/c_src/Makefile.in index 45dc01e993..adc14f0bb1 100644 --- a/lib/os_mon/c_src/Makefile.in +++ b/lib/os_mon/c_src/Makefile.in @@ -63,14 +63,10 @@ ENTRY_OBJ=$(ERL_TOP)/erts/obj/$(TARGET)/port_entry.o PORT_ENTRY_POINT=erl_port_entry ENTRY_LDFLAGS=-entry:$(PORT_ENTRY_POINT) else -ifeq ($(findstring vxworks_simso,$(TARGET)),vxworks_simso) -PROGRAMS = -else PROGRAMS = \ memsup @os_mon_programs@ C_FILES= $(PROGRAMS:%=%.c) endif -endif TARGET_FILES= $(PROGRAMS:%=$(BINDIR)/%) @@ -127,14 +123,10 @@ $(OBJDIR)/memsup.o: memsup.h # ---------------------------------------------------- include $(ERL_TOP)/make/otp_release_targets.mk -ifeq ($(findstring vxworks_simso,$(TARGET)),vxworks_simso) -release_spec: -else release_spec: opt $(INSTALL_DIR) "$(RELSYSDIR)/src" $(INSTALL_DATA) $(C_FILES) "$(RELSYSDIR)/src" $(INSTALL_DIR) "$(RELSYSDIR)/priv/bin" $(INSTALL_PROGRAM) $(TARGET_FILES) "$(RELSYSDIR)/priv/bin" -endif release_docs_spec: diff --git a/lib/os_mon/c_src/memsup.c b/lib/os_mon/c_src/memsup.c index 078f20ff98..b1a001f9c5 100644 --- a/lib/os_mon/c_src/memsup.c +++ b/lib/os_mon/c_src/memsup.c @@ -31,7 +31,7 @@ * * This program is started from Erlang as follows, * - * Port = open_port({spawn, 'memsup'}, [{packet,1}]) for UNIX and VxWorks + * Port = open_port({spawn, 'memsup'}, [{packet,1}]) for UNIX * * Erlang sends one of the request condes defined in memsup.h and this program * answers in one of two ways: @@ -75,10 +75,6 @@ * that there is no process at the other end of the connection * having the connection open for writing (end-of-file). * - * COMPILING - * - * When the target is VxWorks the identifier VXWORKS must be defined for - * the preprocessor (usually by a -D option). */ #if defined(sgi) || defined(__sgi) || defined(__sgi__) @@ -90,9 +86,7 @@ #include #include -#ifndef VXWORKS #include -#endif #if (defined(__unix__) || defined(unix)) && !defined(USG) #include @@ -104,12 +98,6 @@ #include #include -#ifdef VXWORKS -#include -#include -#include -#endif - #ifdef BSD4_4 #include #include @@ -143,20 +131,8 @@ /* prototypes */ static void print_error(const char *,...); -#ifdef VXWORKS -extern int erl_mem_info_get(MEM_PART_STATS *); -#endif - -#ifdef VXWORKS -#define MAIN memsup -static MEM_PART_STATS latest; -static unsigned long latest_system_total; /* does not fit in the struct */ - -#else #define MAIN main -#endif - /* * example, we want procfs information, now give them something equivalent: @@ -282,16 +258,6 @@ send_tag(int value){ } } - -#ifdef VXWORKS -static void load_statistics(void){ - if(memPartInfoGet(memSysPartId,&latest) != OK) - memset(&latest,0,sizeof(latest)); - latest_system_total = latest.numBytesFree + latest.numBytesAlloc; - erl_mem_info_get(&latest); /* if it fails, latest is untouched */ -} -#endif - #ifdef BSD4_4 static int get_vmtotal(struct vmtotal *vt) { @@ -358,19 +324,6 @@ get_mem_procfs(memory_ext *me){ /* arch specific functions */ -#if defined(VXWORKS) -static int -get_extended_mem_vxwork(memory_ext *me) { - load_statistics(); - me->total = (latest.numBytesFree + latest.numBytesAlloc); - me->free = latest.numBytesFree; - me->pagesize = 1; - me->flag = F_MEM_TOTAL | F_MEM_FREE; - return 1; -} -#endif - - #if defined(__linux__) /* ifdef SYSINFO */ /* sysinfo does not include cached memory which is a problem. */ static int @@ -442,12 +395,8 @@ get_extended_mem_sgi(memory_ext *me) { static void get_extended_mem(memory_ext *me) { -/* vxworks */ -#if defined(VXWORKS) - if (get_extended_mem_vxworks(me)) return; - /* linux */ -#elif defined(__linux__) +#if defined(__linux__) if (get_mem_procfs(me)) return; if (get_extended_mem_sysinfo(me)) return; @@ -477,12 +426,7 @@ get_extended_mem(memory_ext *me) { static void get_basic_mem(unsigned long *tot, unsigned long *used, unsigned long *pagesize){ -#if defined(VXWORKS) - load_statistics(); - *tot = (latest.numBytesFree + latest.numBytesAlloc); - *used = latest.numBytesAlloc; - *pagesize = 1; -#elif defined(_SC_AVPHYS_PAGES) /* Does this exist on others than Solaris2? */ +#if defined(_SC_AVPHYS_PAGES) /* Does this exist on others than Solaris2? */ unsigned long avPhys, phys, pgSz; phys = sysconf(_SC_PHYS_PAGES); @@ -557,17 +501,8 @@ extended_show_mem(void){ if (me.flag & F_SWAP_TOTAL) { send_tag(SWAP_TOTAL); send(me.total_swap, ps); } if (me.flag & F_SWAP_FREE) { send_tag(SWAP_FREE); send(me.free_swap, ps); } -#ifdef VXWORKS - send_tag(SM_SYSTEM_TOTAL); - send(latest_system_total, 1); - send_tag(SM_LARGEST_FREE); - send(latest.maxBlockSizeFree, 1); - send_tag(SM_NUMBER_OF_FREE); - send(latest.numBlocksFree, 1); -#else /* total is system total*/ if (me.flag & F_MEM_TOTAL) { send_tag(MEM_SYSTEM_TOTAL); send(me.total, ps); } -#endif send_tag(SHOW_SYSTEM_MEM_END); } diff --git a/lib/os_mon/src/memsup.erl b/lib/os_mon/src/memsup.erl index 54771b4703..a1b8591c8c 100644 --- a/lib/os_mon/src/memsup.erl +++ b/lib/os_mon/src/memsup.erl @@ -185,7 +185,6 @@ init([]) -> {unix, irix} -> true; {unix, sunos} -> true; {win32, _OSname} -> false; - vxworks -> true; _ -> exit({unsupported_os, OS}) end, @@ -617,8 +616,7 @@ code_change(Vsn, PrevState, "1.8") -> {unix, openbsd} -> true; {unix, netbsd} -> true; {unix, sunos} -> true; - {win32, _OSname} -> false; - vxworks -> true + {win32, _OSname} -> false end, Pid = if PortMode -> spawn_link(fun() -> port_init() end); diff --git a/lib/os_mon/src/os_mon.erl b/lib/os_mon/src/os_mon.erl index 2b6cd7c498..df1eccb064 100644 --- a/lib/os_mon/src/os_mon.erl +++ b/lib/os_mon/src/os_mon.erl @@ -177,8 +177,6 @@ services({unix, _}) -> % Other unix. [cpu_sup, disksup, memsup]; services({win32, _}) -> [disksup, memsup, os_sup, sysinfo]; -services(vxworks) -> - [memsup]; services(_) -> []. -- cgit v1.2.3