]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/sh64/kernel/alphanum.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6-omap-h63xx.git] / arch / sh64 / kernel / alphanum.c
1 /*
2  * arch/sh64/kernel/alphanum.c
3  *
4  * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
5  *
6  * May be copied or modified under the terms of the GNU General Public
7  * License.  See linux/COPYING for more information.
8  *
9  * Machine-independent functions for handling 8-digit alphanumeric display
10  * (e.g. Agilent HDSP-253x)
11  */
12 #include <linux/stddef.h>
13 #include <linux/sched.h>
14
15 void mach_alphanum(int pos, unsigned char val);
16
17 void print_seg(char *file, int line)
18 {
19         int i;
20         unsigned int nibble;
21
22         for (i = 0; i < 5; i++) {
23                 mach_alphanum(i, file[i]);
24         }
25
26         for (i = 0; i < 3; i++) {
27                 nibble = ((line >> (i * 4)) & 0xf);
28                 mach_alphanum(7 - i, nibble + ((nibble > 9) ? 55 : 48));
29         }
30 }
31
32 void print_seg_num(unsigned num)
33 {
34         int i;
35         unsigned int nibble;
36
37         for (i = 0; i < 8; i++) {
38                 nibble = ((num >> (i * 4)) & 0xf);
39
40                 mach_alphanum(7 - i, nibble + ((nibble > 9) ? 55 : 48));
41         }
42 }
43