patch-2.4.19 linux-2.4.19/arch/ppc/kernel/residual.c
Next file: linux-2.4.19/arch/ppc/kernel/setup.c
Previous file: linux-2.4.19/arch/ppc/kernel/qspan_pci.c
Back to the patch index
Back to the overall index
- Lines: 46
- Date:
Fri Aug 2 17:39:43 2002
- Orig file:
linux-2.4.18/arch/ppc/kernel/residual.c
- Orig date:
Mon Oct 8 11:43:01 2001
diff -urN linux-2.4.18/arch/ppc/kernel/residual.c linux-2.4.19/arch/ppc/kernel/residual.c
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.residual.c 1.13 09/11/01 16:54:34 trini
+ * BK Id: SCCS/s.residual.c 1.15 02/05/02 18:08:35 trini
*/
/*
* Code to deal with the PReP residual data.
@@ -876,3 +876,38 @@
};
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
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)