📄 trace_intr.h
字号:
#ifndef __ASM_TRACE_USER_H#define __ASM_TRACE_USER_H/* This file (trace_user.h) was created by Ron Rechenmacher <ron@fnal.gov> on Dec 13, 1999. "TERMS AND CONDITIONS" governing this file are in the README or COPYING file. If you do not have such a file, one can be obtained by contacting Ron or Fermi Lab in Batavia IL, 60510, phone: 630-840-3000.*/#define __TRACE_INTR_H_REV "\$RCSfile: trace_intr.h,v $(alpha)\$Revision: 1.4 $\$Date: 2000/06/05 17:23:51 $"#include <asm/pal.h> /* PAL_gentrap *//* TRACE_VECTOR is not a "vector" as this term originated from the i386 port which was done first. For alpha, this should be called "trap" (maybe I'll change it).*//* I should probably patch: include/asm-alpha/gentrap.h (WITH A NEW GEN_TRACE DEFINE) and arch/alpha/kernel/traps.c then remove this define.*/#define TRACE_VECTOR -52 /* arbitrary - see include/asm-alpha/gentrap.h */#ifdef __KERNEL__ /* ------------------------------------------------------- */voidtrace_interrupt_init( void );#else /* of ifdef __KERNEL__ ----------------------------------------------- *//****************************************************************************** * trace_function * * It is OK that this is a function call as the "if" statement in the * TRACE macro is the critical item. * And since we can make it a function (where everything will be organized * on the stack, all we have to do is pass a pointer to the start location * on the stack. * * Ref. (did not find in libc) include/asm-alpha/system.h */static voidtrace_function( struct timeval *time , int tid /*, int lvl , char *msg*/ , ... ){ va_list ap; int ii; struct { int lvl; char *msg; int params[traceControl_sp->numberOfParameter_integers]; } kk; register long _sc_0 __asm__("$0"); register long _sc_16 __asm__("$16"); register long _sc_17 __asm__("$17"); register long _sc_18 __asm__("$18"); va_start( ap, tid ); kk.lvl = va_arg( ap, int ); kk.msg = va_arg( ap, char * ); for (ii=0; ii<traceControl_sp->numberOfParameter_integers; ii++) { kk.params[ii] = va_arg( ap, int ); } printf( "&tid=%p tid=0x%x &time=%p time=%p\n" , &tid, tid, &time, time ); _sc_0 = (long)time; _sc_16 = TRACE_VECTOR; /* this is passed as "type" to traps.c:do_entIF */ _sc_17 = (long)tid; _sc_18 = (long)&kk; /* PAL_gentrap code gets handled in: arch/alpha/kernel/traps.c:do_entIF() called from arch/alpha/kernel/entry.S:entIF: This was determined simply by finding a " gentrap " comment!!! PAL_gentrap is defined in include/asm-alpha/pal.h The defined "pals" (in include/asm-alpha/pal.h) are: 0-2,9,10,13,16,17,41,43,45,46,48-63,128,129,131,134,158,159,170,190 HOW DOES ONE SETUP A NEW PAL??? I.E. WHAT WOULD/DOES HAPPEN IF/WHEN I DID/DO: call_pal 80 HOW DO I GET TO arch/alpha/kernel/entry.S??? entIF is used in wrent call in arch/alpha/kernel/traps.c:trap_init(void) wrent(entIF, 3) entIF stands for entry - INstruction Fault WHAT IS THE CORRELATION BETWEEN 3 and 170 (PAL_gentrap)??? wrent is arch/alpha/boot/head.S:wrent: (wrentstands for write system entry address) which does: call_pal PAL_wrent (PAL_wrent=52) OR __CALL_PAL_W2(wrent...) from include/asm-alpha/system.h Incidently, PAL_callsys=131(0x83) may correlate to wrent(entSys,5) Actually PAL_gentrap,170(0xAA) goes to entIF(3) with a type param=2 PAL_bugchk, 129(0x81) goes to entIF(3) with a type param=1 PAL_bpt, 128(0x80) goes to entIF(3) with a type param=0 PAL_wrfen, 43(0x2B) goes to entIF(3) with a type param=3??? FEN fault PAL_???, ??(0x??) goes to entIF(3) with a type param=4 opDEC the (i386 equivalent) rti instruction used at end of ret_from_sys_call is actually a PAL "call_pal PAL_rti" */ __asm__( "call_pal %0": : "i"(PAL_gentrap) ); va_end( ap ); return;} /* trace_function */#endif /* of else of ifdef __KERNEL__ ------------------------------------- *//* ------------------------------------------------------------------------- */#endif /* __ASM_TRACE_USER_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -