CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
cpuinfo.c-Dateireferenz
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
#include "ctype.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 ()
 
void cpuinfo_finish (__attribute__((unused)) unsigned dummy)
 

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 58 der Datei cpuinfo.c.

Dokumentation der Funktionen

int basic_module_init ( )

Definiert in Zeile 110 der Datei cpuinfo.c.

110  {
112  return 1;
113 }
void cpuinfo_finish ( unsigned  dummy)
void cpuinfo_finish ( __attribute__((unused)) unsigned  dummy)

Definiert in Zeile 116 der Datei cpuinfo.c.

116  {
117  running=0;
118 }
void cpuinfo_write_file ( void  )

Definiert in Zeile 63 der Datei cpuinfo.c.

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

Definiert in Zeile 36 der Datei cpuinfo.c.

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

Variablen-Dokumentation

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

Definiert in Zeile 21 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 30 der Datei cpuinfo.c.