]> Zhao Yanbai Git Server - minix.git/commitdiff
dynamic HZ, library stacktrace
authorBen Gras <ben@minix3.org>
Thu, 11 Dec 2008 14:54:42 +0000 (14:54 +0000)
committerBen Gras <ben@minix3.org>
Thu, 11 Dec 2008 14:54:42 +0000 (14:54 +0000)
servers/inet/Makefile
servers/inet/inet.c
servers/inet/inet.h
servers/inet/stacktrace.c [deleted file]

index 2a8c65c66da6ffec17e9bdec2409ef5ea1b26d6b..632387b2305ced222db77742187a0fb828090036 100644 (file)
@@ -14,7 +14,7 @@ LIBS =           -lsys
        $(CC) $(CFLAGS) -o $@ -c $<
 
 OBJ =  buf.o clock.o inet.o inet_config.o \
-       mnx_eth.o mq.o qp.o sr.o stacktrace.o \
+       mnx_eth.o mq.o qp.o sr.o \
        $g/udp.o $g/arp.o $g/eth.o $g/event.o \
        $g/icmp.o $g/io.o $g/ip.o $g/ip_ioctl.o \
        $g/ip_lib.o $g/ip_read.o $g/ip_write.o \
index c7f5de9555ae0ea8cb7c16e18619b377c9243144..cfc06acebcfa424494caea3fa7fb0b4366112299 100644 (file)
@@ -87,6 +87,10 @@ int killer_inet= 0;
 extern int inet_buf_debug;
 #endif
 
+#if HZ_DYNAMIC
+u32_t system_hz;
+#endif
+
 _PROTOTYPE( void main, (void) );
 
 FORWARD _PROTOTYPE( void nw_conf, (void) );
@@ -110,6 +114,10 @@ PUBLIC void main()
        printf("%s\n", version);
 #endif
 
+#if HZ_DYNAMIC
+       system_hz = sys_hz();
+#endif
+
        /* Read configuration. */
        nw_conf();
 
@@ -315,7 +323,7 @@ int line;
 PUBLIC void inet_panic()
 {
        printf("\ninet stacktrace: ");
-       stacktrace();
+       util_stacktrace();
 #ifdef __minix_vmd
        sys_abort(RBT_PANIC);
 #else /* Minix 3 */
index 61a8f6c39a143fdc1d7533989307428a25df2486..9dcdbd5eec5fc4dbfa897fa5d21bdae893c3a172 100644 (file)
@@ -88,7 +88,7 @@ _PROTOTYPE( void inet_panic, (void) ) _NORETURN;
                printf("warning at %s, %d: ", this_file, __LINE__), \
                printf print_list, \
                printf("\ninet stacktrace: "), \
-               stacktrace() \
+               util_stacktrace() \
        )
 #else
 #define ip_warning(print_list) ((void) 0)
@@ -109,7 +109,11 @@ _PROTOTYPE( void inet_panic, (void) ) _NORETURN;
 extern int this_proc;
 extern char version[];
 
-void stacktrace ARGS(( void ));
+#ifndef HZ
+EXTERN u32_t system_hz;
+#define HZ system_hz
+#define HZ_DYNAMIC 1
+#endif
 
 #endif /* INET__INET_H */
 
diff --git a/servers/inet/stacktrace.c b/servers/inet/stacktrace.c
deleted file mode 100644 (file)
index d4e8adf..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-stacktrace.c
-
-Created:       Jan 19, 1993 by Philip Homburg
-
-Copyright 1995 Philip Homburg
-*/
-
-#include "inet.h"
-
-PUBLIC void stacktrace()
-{
-       typedef unsigned int reg_t;
-       reg_t bp, pc, hbp;
-       extern reg_t get_bp ARGS(( void ));
-
-       bp= get_bp();
-       while(bp)
-       {
-               pc= ((reg_t *)bp)[1];
-               hbp= ((reg_t *)bp)[0];
-               printf("0x%lx ", (unsigned long)pc);
-               if (hbp != 0 && hbp <= bp)
-               {
-                       printf("???");
-                       break;
-               }
-               bp= hbp;
-       }
-       printf("\n");
-}
-
-/*
- * $PchId: stacktrace.c,v 1.6 1996/05/07 21:11:34 philip Exp $
- */