Commit 6db2ecc9 authored by Tom Rini's avatar Tom Rini

PPC32: Forward-port the /proc/residual stuffs from 2.4. This is

originally by David Monro, updated by Sven Dickert and Hollis Blanchard,
and this version which only vaugly resembles any of those and is by
Leigh Brown <leigh@solinno.co.uk>.
parent 9a4d5c37
......@@ -340,9 +340,16 @@ CONFIG_PREP_RESIDUAL
other useful pieces of information. Sometimes this information is
not present or incorrect.
Unless you expect to boot on a PReP system, there is not need to
Unless you expect to boot on a PReP system, there is no need to
select Y.
PReP residual data available in /proc/residual
CONFIG_PROC_PREPRESIDUAL
Enabling this option will create a /proc/residual file which allows
you to get at the residual data on PReP systems. You will need a tool
(lsresidual) to parse it. If you aren't on a PReP system, you don't
want this.
CONFIG_ADB
Apple Desktop Bus (ADB) support is for support of devices which
are connected to an ADB port. ADB devices tend to have 4 pins.
......
......@@ -362,6 +362,7 @@ if [ "$CONFIG_ALL_PPC" = "y" ]; then
bool 'Support for Open Firmware device tree in /proc' CONFIG_PROC_DEVICETREE
bool 'Support for RTAS (RunTime Abstraction Services) in /proc' CONFIG_PPC_RTAS
bool 'Support for PReP Residual Data' CONFIG_PREP_RESIDUAL
dep_bool ' Support for reading of PReP Residual Data in /proc' CONFIG_PROC_PREPRESIDUAL $CONFIG_PREP_RESIDUAL
fi
bool 'Default bootloader kernel arguments' CONFIG_CMDLINE_BOOL
......
......@@ -876,3 +876,38 @@ PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
};
return 0; /* not found */
}
#ifdef CONFIG_PROC_PREPRESIDUAL
static int proc_prep_residual_read(char * buf, char ** start, off_t off,
int count, int *eof, void *data)
{
int n;
n = res->ResidualLength - off;
if (n < 0) {
*eof = 1;
n = 0;
}
else {
if (n > count)
n = count;
else
*eof = 1;
memcpy(buf, (char *)res + off, n);
*start = buf;
}
return n;
}
void __init
proc_prep_residual_init(void)
{
if (res->ResidualLength)
create_proc_read_entry("residual", S_IRUGO, NULL,
proc_prep_residual_read, NULL);
}
__initcall(proc_prep_residual_init);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment