Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116947
b: refs/heads/master
c: 34d81f8
h: refs/heads/master
i:
  116945: 8600e17
  116943: 9aa2475
v: v3
  • Loading branch information
Milton Miller authored and Benjamin Herrenschmidt committed Oct 21, 2008
1 parent 5d7bae8 commit ea97235
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0dcd440120ef12879ff34fc78d7e4abf171c79e4
refs/heads/master: 34d81f858a3bdec568bf08c4feb997ccd3d40b94
61 changes: 0 additions & 61 deletions trunk/arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,67 +487,6 @@ static int __init prom_setprop(phandle node, const char *nodename,
return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd);
}

/* We can't use the standard versions because of RELOC headaches. */
#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
|| ('a' <= (c) && (c) <= 'f') \
|| ('A' <= (c) && (c) <= 'F'))

#define isdigit(c) ('0' <= (c) && (c) <= '9')
#define islower(c) ('a' <= (c) && (c) <= 'z')
#define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c))

unsigned long prom_strtoul(const char *cp, const char **endp)
{
unsigned long result = 0, base = 10, value;

if (*cp == '0') {
base = 8;
cp++;
if (toupper(*cp) == 'X') {
cp++;
base = 16;
}
}

while (isxdigit(*cp) &&
(value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) {
result = result * base + value;
cp++;
}

if (endp)
*endp = cp;

return result;
}

unsigned long prom_memparse(const char *ptr, const char **retptr)
{
unsigned long ret = prom_strtoul(ptr, retptr);
int shift = 0;

/*
* We can't use a switch here because GCC *may* generate a
* jump table which won't work, because we're not running at
* the address we're linked at.
*/
if ('G' == **retptr || 'g' == **retptr)
shift = 30;

if ('M' == **retptr || 'm' == **retptr)
shift = 20;

if ('K' == **retptr || 'k' == **retptr)
shift = 10;

if (shift) {
ret <<= shift;
(*retptr)++;
}

return ret;
}

/*
* Early parsing of the command line passed to the kernel, used for
* "mem=x" and the options that affect the iommu
Expand Down

0 comments on commit ea97235

Please sign in to comment.