[질문]구형스팍머쉰에서 LED제어할려고 하는데..
글쓴이: sekisuri / 작성시간: 수, 2003/11/19 - 5:46오후
레뎃6.2설치된 스팍머쉰 프린트포트에 LED꽃아서 간단하게
제어해볼라고 하는데요..
#include <stdio.h> #include <unistd.h> #include <sys/io.h> #include <stdlib.h> #define PORT 0x378 int main() { while(1){ ioperm(PORT,3,1); outb(0x09,PORT); sleep(1); outb(0x06,PORT); sleep(1); } } [root@node00 /root]# gcc check.c -o check /usr/include/asm-sparc/io.h: In function `mapioaddr': In file included from /usr/include/sys/io.h:6, from check.c:3: /usr/include/asm-sparc/io.h:107: `sparc_cpu_model' undeclared (first use in this function) /usr/include/asm-sparc/io.h:107: (Each undeclared identifier is reported only on ce /usr/include/asm-sparc/io.h:107: for each function it appears in.) /usr/include/asm-sparc/io.h:110: warning: unreachable code at beginning of switc h statement /usr/include/asm-sparc/io.h: In function `unmapioaddr': /usr/include/asm-sparc/io.h:131: `sparc_cpu_model' undeclared (first use in this function) /usr/include/asm-sparc/io.h:134: warning: unreachable code at beginning of switc h statement /usr/include/asm-sparc/io.h: At top level: /usr/include/asm-sparc/io.h:148: parse error before `pa'
위와같은 에러가 나는데 에러나는 부분을 보니까
extern __inline__ void mapioaddr(unsigned long physaddr, unsigned long virt_addr, int bus, int rdonly) { switch(sparc_cpu_model) { case sun4c: case sun4: sun4c_mapioaddr(physaddr, virt_addr, bus, rdonly); break; case sun4m: case sun4d: case sun4e: srmmu_mapioaddr(physaddr, virt_addr, bus, rdonly); break; default: printk("mapioaddr: Trying to map IO space for unsupported machine.\n"); printk("mapioaddr: sparc_cpu_model = %d\n", sparc_cpu_model); printk("mapioaddr: Halting...\n"); halt(); }; return; }
위부분에서 에러가 나는것 같은데
어떻게 수정을 해주어야 될지 잘모르겠네요.. ^^;;
[root@node00 /root]# cat /proc/cpuinfo
cpu : Texas Instruments, Inc. - SuperSparc 50
fpu : SuperSparc on-chip FPU
promlib : Version 3 Revision 2
prom : 2.22
type : sun4m
ncpus probed : 1
ncpus active : 1
BogoMips : 59.80
MMU type : TI Viking/MXCC
invall : 0
invmm : 0
invrnge : 0
invpg : 0
contexts : 65536
앗 글구요.. 스팍에서도 프린트포트 넘버가 378번 맞나요? ^^;
컴파일러 버젼은 gcc version 2.95.3 20010315 (release) 입니다
Forums:
댓글 달기