CHDK_DE Vorschauversion  Trunk Rev. 5163
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
cpuinfo.c-Dateireferenz
#include "stdlib.h"
#include "gui_mbox.h"
#include "gui.h"
#include "gui_lang.h"
#include "lang.h"
#include "cpuinfo_v5.c"
#include "simple_module.c"
+ Include-Abhängigkeitsdiagramm für cpuinfo.c:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  cpuinfo_bitfield_desc_s
 
struct  cpuinfo_word_desc_s
 

Makrodefinitionen

#define NUM_CPUINFO_WORDS   ((sizeof(cpuinfo_desc)/sizeof(cpuinfo_desc[0])) - 1)
 

Funktionen

static const char * regperm_str (unsigned val)
 
void cpuinfo_finish (unsigned dummy)
 
void cpuinfo_get_info (unsigned *results)
 
void cpuinfo_write_file (void)
 
int basic_module_init ()
 

Variablen

struct cpuinfo_bitfield_desc_s cpuinf_id []
 
static const char * reg_sizes []
 
ModuleInfo _module_info
 

Makro-Dokumentation

#define NUM_CPUINFO_WORDS   ((sizeof(cpuinfo_desc)/sizeof(cpuinfo_desc[0])) - 1)

Definiert in Zeile 53 der Datei cpuinfo.c.

Dokumentation der Funktionen

int basic_module_init ( )

Definiert in Zeile 91 der Datei cpuinfo.c.

91  {
93  return 1;
94 }
void cpuinfo_finish ( unsigned  dummy)

Definiert in Zeile 97 der Datei cpuinfo.c.

97  {
98  running=0;
99 }
void cpuinfo_get_info ( unsigned *  results)
void cpuinfo_write_file ( void  )

Definiert in Zeile 58 der Datei cpuinfo.c.

58  {
59  unsigned cpuinfo[NUM_CPUINFO_WORDS];
60  int i,j;
61  unsigned fieldval,wordval;
62  unsigned mask,bits;
63  FILE *finfo;
64  char buf[100];
65  char *p;
66  cpuinfo_get_info(cpuinfo);
67  finfo=fopen("A/CPUINFO.TXT", "wb");
68  for(i = 0; cpuinfo_desc[i].name; i++) {
69  wordval = cpuinfo[i];
70  sprintf(buf,"%-10s 0x%08X\n",cpuinfo_desc[i].name,wordval);
71  fwrite(buf,1,strlen(buf),finfo);
72  for(j=0; cpuinfo_desc[i].fields[j].name; j++) {
73  p=buf;
74  bits = cpuinfo_desc[i].fields[j].bits;
75  mask = ~(0xFFFFFFFF << bits);
76  fieldval = wordval & mask;
77  p+=sprintf(p," %-20s 0x%X %d",cpuinfo_desc[i].fields[j].name,fieldval,fieldval);
78  if(cpuinfo_desc[i].fields[j].desc_fn) {
79  p+=sprintf(p," [%s]",cpuinfo_desc[i].fields[j].desc_fn(fieldval));
80  }
81  strcat(p,"\n");
82  fwrite(buf,1,strlen(buf),finfo);
83  wordval >>= bits;
84  }
85  }
86  fclose(finfo);
87  sprintf(buf, lang_str(LANG_CPUINFO_WROTE), "A/CPUINFO.TXT");
89 }
static const char* regperm_str ( unsigned  val)
static

Definiert in Zeile 33 der Datei cpuinfo.c.

33  {
34  switch(val) {
35  case 0: return "P:-- U:--";
36  case 1: return "P:RW U:--";
37  case 2: return "P:RW U:R-";
38  case 3: return "P:RW U:RW";
39  case 5: return "P:R- U:--";
40  case 6: return "P:R- U:R-";
41  default:
42  return "P:?? U:??";
43  }
44 }

Variablen-Dokumentation

struct cpuinfo_bitfield_desc_s cpuinf_id[]
Initialisierung:
= {
{4,"Revision"},
{12,"Part"},
{4,"ARM Arch"},
{4,"Variant"},
{8,"Implementor"},
{}
}

Definiert in Zeile 18 der Datei cpuinfo.c.

const char* reg_sizes[]
static
Initialisierung:
= {
"4K", "8K", "16K", "32K", "64K", "128K", "256K", "512K",
"1M", "2M", "4M", "8M", "16M", "32M", "64M", "128M", "256M", "512M",
"1G", "2G", "4G",
}

Definiert in Zeile 27 der Datei cpuinfo.c.