aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/prom_init.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 2fdbc18ae94a..23e0db203329 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -487,67 +487,6 @@ static int __init prom_setprop(phandle node, const char *nodename,
487 return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd); 487 return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd);
488} 488}
489 489
490/* We can't use the standard versions because of RELOC headaches. */
491#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
492 || ('a' <= (c) && (c) <= 'f') \
493 || ('A' <= (c) && (c) <= 'F'))
494
495#define isdigit(c) ('0' <= (c) && (c) <= '9')
496#define islower(c) ('a' <= (c) && (c) <= 'z')
497#define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c))
498
499unsigned long prom_strtoul(const char *cp, const char **endp)
500{
501 unsigned long result = 0, base = 10, value;
502
503 if (*cp == '0') {
504 base = 8;
505 cp++;
506 if (toupper(*cp) == 'X') {
507 cp++;
508 base = 16;
509 }
510 }
511
512 while (isxdigit(*cp) &&
513 (value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) {
514 result = result * base + value;
515 cp++;
516 }
517
518 if (endp)
519 *endp = cp;
520
521 return result;
522}
523
524unsigned long prom_memparse(const char *ptr, const char **retptr)
525{
526 unsigned long ret = prom_strtoul(ptr, retptr);
527 int shift = 0;
528
529 /*
530 * We can't use a switch here because GCC *may* generate a
531 * jump table which won't work, because we're not running at
532 * the address we're linked at.
533 */
534 if ('G' == **retptr || 'g' == **retptr)
535 shift = 30;
536
537 if ('M' == **retptr || 'm' == **retptr)
538 shift = 20;
539
540 if ('K' == **retptr || 'k' == **retptr)
541 shift = 10;
542
543 if (shift) {
544 ret <<= shift;
545 (*retptr)++;
546 }
547
548 return ret;
549}
550
551/* 490/*
552 * Early parsing of the command line passed to the kernel, used for 491 * Early parsing of the command line passed to the kernel, used for
553 * "mem=x" and the options that affect the iommu 492 * "mem=x" and the options that affect the iommu