OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [stdalone/] [mkpart/] [mkptbl/] [mkptbl.c] - Diff between revs 18 and 259

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 18 Rev 259
Line 15... Line 15...
 
 
#define LINE_SIZE       100
#define LINE_SIZE       100
 
 
 
 
typedef struct {
typedef struct {
  unsigned long type;
  unsigned int type;
  unsigned long start;
  unsigned int start;
  unsigned long size;
  unsigned int size;
  char descr[DESCR_SIZE];
  char descr[DESCR_SIZE];
} PartEntry;
} PartEntry;
 
 
PartEntry ptr[NPE];
PartEntry ptr[NPE];
 
 
Line 36... Line 36...
  va_end(ap);
  va_end(ap);
  exit(1);
  exit(1);
}
}
 
 
 
 
void convertNumber(unsigned char *p, unsigned long val) {
void convertNumber(unsigned char *p, unsigned int val) {
  *(p + 0) = val >> 24;
  *(p + 0) = val >> 24;
  *(p + 1) = val >> 16;
  *(p + 1) = val >> 16;
  *(p + 2) = val >>  8;
  *(p + 2) = val >>  8;
  *(p + 3) = val >>  0;
  *(p + 3) = val >>  0;
}
}
Line 57... Line 57...
    convertNumber(p + 8, e[i].size);
    convertNumber(p + 8, e[i].size);
  }
  }
}
}
 
 
 
 
int parseNumber(char **pc, unsigned long *pi) {
int parseNumber(char **pc, unsigned int *pi) {
  char *p;
  char *p;
  unsigned int base, dval;
  unsigned int base, dval;
  unsigned long n;
  unsigned int n;
 
 
  p = *pc;
  p = *pc;
  while (*p == ' ' || *p == '\t') {
  while (*p == ' ' || *p == '\t') {
    p++;
    p++;
  }
  }
Line 148... Line 148...
  FILE *conf;
  FILE *conf;
  FILE *out;
  FILE *out;
  char line[LINE_SIZE];
  char line[LINE_SIZE];
  char *p;
  char *p;
  int lineNumber;
  int lineNumber;
  unsigned long partNum;
  unsigned int partNum;
  unsigned long bootable;
  unsigned int bootable;
  unsigned long partType;
  unsigned int partType;
  unsigned long partStart;
  unsigned int partStart;
  unsigned long partLast;
  unsigned int partLast;
  unsigned long partSize;
  unsigned int partSize;
  char descr[LINE_SIZE];
  char descr[LINE_SIZE];
 
 
  /* check command line arguments */
  /* check command line arguments */
  if (argc != 3) {
  if (argc != 3) {
    printf("Usage: %s <configuration file> <output file>\n", argv[0]);
    printf("Usage: %s <configuration file> <output file>\n", argv[0]);
Line 249... Line 249...
    if (ptr[partNum].type != 0) {
    if (ptr[partNum].type != 0) {
      partLast = ptr[partNum].start + ptr[partNum].size - 1;
      partLast = ptr[partNum].start + ptr[partNum].size - 1;
    } else {
    } else {
      partLast = 0;
      partLast = 0;
    }
    }
    printf("%2lu %s 0x%08lX 0x%08lX 0x%08lX 0x%08lX %s\n",
    printf("%2u %s 0x%08X 0x%08X 0x%08X 0x%08X %s\n",
           partNum,
           partNum,
           ptr[partNum].type & 0x80000000 ? "*" : " ",
           ptr[partNum].type & 0x80000000 ? "*" : " ",
           ptr[partNum].type & 0x7FFFFFFF,
           ptr[partNum].type & 0x7FFFFFFF,
           ptr[partNum].start,
           ptr[partNum].start,
           partLast,
           partLast,

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.