OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [uClinux-2.0.x/] [drivers/] [isdn/] [sc/] [debug.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 *  $Id: debug.c,v 1.1.1.1 2001-09-10 07:44:19 simons Exp $
3
 *  Copyright (C) 1996  SpellCaster Telecommunications Inc.
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
17
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
 *
19
 *  For more information, please contact gpl-info@spellcast.com or write:
20
 *
21
 *     SpellCaster Telecommunications Inc.
22
 *     5621 Finch Avenue East, Unit #3
23
 *     Scarborough, Ontario  Canada
24
 *     M1B 2T9
25
 *     +1 (416) 297-8565
26
 *     +1 (416) 297-6433 Facsimile
27
 */
28
#include <linux/kernel.h>
29
 
30
#define NULL    0x0
31
 
32
#if LINUX_VERSION_CODE < 66363  /* Linux 1.3.59 there was a change to interrupts */
33
        #define REQUEST_IRQ(a,b,c,d,e) request_irq(a,b,c,d)
34
        #define FREE_IRQ(a,b) free_irq(a)
35
#else
36
        #define REQUEST_IRQ(a,b,c,d,e) request_irq(a,b,c,d,e)
37
        #define FREE_IRQ(a,b) free_irq(a,b)
38
#endif
39
 
40
inline char *strcpy(char *, const char *);
41
 
42
int dbg_level = 0;
43
static char dbg_funcname[255];
44
 
45
void dbg_endfunc(void)
46
{
47
        if (dbg_level) {
48
                printk("<-- Leaving function %s\n", dbg_funcname);
49
                strcpy(dbg_funcname, "");
50
        }
51
}
52
 
53
void dbg_func(char *func)
54
{
55
        strcpy(dbg_funcname, func);
56
        if(dbg_level)
57
                printk("--> Entering function %s\n", dbg_funcname);
58
}
59
 
60
inline char *strcpy(char *dest, const char *src)
61
{
62
        char *i = dest;
63
        char *j = (char *) src;
64
 
65
        while(*j) {
66
                *i = *j;
67
                i++; j++;
68
        }
69
        *(++i) = NULL;
70
        return dest;
71
}
72
 
73
inline void pullphone(char *dn, char *str)
74
{
75
        int i = 0;
76
 
77
        while(dn[i] != ',')
78
                str[i] = dn[i++];
79
        str[i] = 0x0;
80
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.