30 #include <linux/types.h>
114 unsigned int rev_int = 0;
121 char *cmd =
"cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}'";
123 if( !(info = popen(cmd,
"r")) )
128 if ( fgets(rev_hex, 5, info) != NULL )
130 sscanf(rev_hex,
"%x", &rev_int);
141 board.model = MODEL_B;
149 board.model = MODEL_B;
157 board.model = MODEL_A;
165 board.model = MODEL_B;
228 unsigned int modcount_int = 0;
230 sprintf(cmd,
"lsmod | grep %s | wc -l", modulename);
232 if( !(lsmod = popen(cmd,
"r")) )
237 if ( fgets(modcount, 2, lsmod) != NULL )
239 modcount_int = atoi(modcount);
247 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.