~pali/+junk/maemo_getbootstate-old

« back to all changes in this revision

Viewing changes to getbootstate.c

  • Committer: Pali Rohár
  • Date: 2011-10-02 09:27:32 UTC
  • Revision ID: pali.rohar@gmail.com-20111002092732-0h9x23st01lnnp19
Minor fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 
86
86
static void log_msg(char* format, ...) __attribute__ ((format (printf, 1, 2)));
87
87
 
88
 
// Behavior from fremantle binary version:
 
88
// Behaviour from fremantle binary version:
89
89
// bootmode is read from file /proc/component_version
90
90
// file structure: <key> <spaces> <value>
91
91
//                 boot-mode <spaces> <bootmode>
122
122
    return ret;
123
123
}
124
124
 
125
 
// Behavior from fremantle binary version:
 
125
// Behaviour from fremantle binary version:
126
126
// bootreason is read from file /proc/bootreason
127
127
static int get_bootreason(char* bootreason, int max_len)
128
128
{
146
146
    return 0;
147
147
}
148
148
 
149
 
// Behavior from fremantle binary version:
 
149
// Behaviour from fremantle binary version:
150
150
// parms structure from kernel module twl4030-madc.c
151
151
// parms: channel = 4, average = 1
152
 
// ioctl /dev/twl4030-adc 0x6000 *parms
 
152
// ioctl /dev/twl4030-adc 0x6000 &parms
153
153
// return: status = 0, result = BSI
154
 
static int get_bsi()
 
154
static int get_bsi(void)
155
155
{
156
156
    int    fd;
157
157
    int    ret;
179
179
 
180
180
// Access cal partition on fremantle
181
181
// If enabled R&D mode return 1 otherwise 0
182
 
static int get_rdmode()
 
182
static int get_rdmode(void)
183
183
{
184
184
    struct cal*   cal;
185
185
    void*         ptr;
411
411
                             LOOP_COUNTING_TYPE count_type)
412
412
{
413
413
    // Only save "normal" bootstates (USER, ACT_DEAD)
414
 
    // Behavior from fremantle binary:
 
414
    // Behaviour from fremantle binary:
415
415
    // Save SHUTDOWN bootstate too
416
416
    static const char* saveable[] = { "USER", "ACT_DEAD", "SHUTDOWN", 0 };
417
417
    int i;
480
480
    rdmode = get_rdmode();
481
481
 
482
482
 
483
 
    // Behavior from fremantle binary version:
 
483
    // Behaviour from fremantle binary version:
484
484
    // BSI 32..85 - Service battery and LOCAL bootstate
485
485
    // BSI 87..176 - Test battery and TEST bootstate
486
486
    // BSI 280..568 - Normal battery and continue checking