30 #include <linux/types.h> 115 unsigned int rev_int = 0;
122 char *cmd =
"cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}'";
124 if( !(info = popen(cmd,
"r")) )
129 if ( fgets(rev_hex, 5, info) != NULL )
131 sscanf(rev_hex,
"%x", &rev_int);
142 board.model = MODEL_B;
150 board.model = MODEL_B;
158 board.model = MODEL_A;
166 board.model = MODEL_B;
229 unsigned int modcount_int = 0;
231 sprintf(cmd,
"lsmod | grep %s | wc -l", modulename);
233 if( !(lsmod = popen(cmd,
"r")) )
238 if ( fgets(modcount, 2, lsmod) != NULL )
240 modcount_int = atoi(modcount);
248 if ( modcount_int > 0 )
int board_mem()
Return the amount of system memory.
board_t board_info()
Return board information (Model, PCB revision and Memory)
int check_kernel_module(char *modulename)
Check if the kernel module specified is loaded.
int board_rev()
Return board revision.
Header for general library functionality.
int board_model()
Return board model.