CHDK_DE Vorschauversion  Trunk Rev. 5575
 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_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 55 der Datei cpuinfo.c.

Dokumentation der Funktionen

int basic_module_init ( )

Definiert in Zeile 107 der Datei cpuinfo.c.

107  {
109  return 1;
110 }
void cpuinfo_finish ( unsigned  dummy)

Definiert in Zeile 113 der Datei cpuinfo.c.

113  {
114  running=0;
115 }
void cpuinfo_write_file ( void  )

Definiert in Zeile 60 der Datei cpuinfo.c.

60  {
61  unsigned cpuinfo[NUM_CPUINFO_WORDS];
62  int i,j;
63  unsigned fieldval,wordval;
64  unsigned mask,bits;
65  FILE *finfo;
66  char buf[100];
67  char *p;
68 #ifdef THUMB_FW
70  if (cpu_is_vmsa()) {
71  FILE *f=fopen("A/MMU_MAP.CSV", "wb");
72  memmapping_vmsa(f);
73  cpuinfo_get_info_vmsa(cpuinfo);
74  cpuinfo_desc = (struct cpuinfo_word_desc_s*) cpuinfo_desc_vmsa;
75  }
76  else {
77  cpuinfo_get_info_pmsa(cpuinfo);
78  cpuinfo_desc = (struct cpuinfo_word_desc_s*) cpuinfo_desc_pmsa;
79  }
80 #else
81  cpuinfo_get_info(cpuinfo);
82 #endif
83  finfo=fopen("A/CPUINFO.TXT", "wb");
84  for(i = 0; cpuinfo_desc[i].name; i++) {
85  wordval = cpuinfo[i];
86  sprintf(buf,"%-10s 0x%08X\n",cpuinfo_desc[i].name,wordval);
87  fwrite(buf,1,strlen(buf),finfo);
88  for(j=0; cpuinfo_desc[i].fields[j].name; j++) {
89  p=buf;
90  bits = cpuinfo_desc[i].fields[j].bits;
91  mask = ~(0xFFFFFFFF << bits);
92  fieldval = wordval & mask;
93  p+=sprintf(p," %-20s 0x%X %d",cpuinfo_desc[i].fields[j].name,fieldval,fieldval);
94  if(cpuinfo_desc[i].fields[j].desc_fn) {
95  p+=sprintf(p," [%s]",cpuinfo_desc[i].fields[j].desc_fn(fieldval));
96  }
97  strcat(p,"\n");
98  fwrite(buf,1,strlen(buf),finfo);
99  wordval >>= bits;
100  }
101  }
102  fclose(finfo);
103  sprintf(buf, lang_str(LANG_CPUINFO_WROTE), "A/CPUINFO.TXT");
105 }
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.