mm: remove fairly useless and non-portable optimisation hack
authorAlan Cox <alan@etchedpixels.co.uk>
Sat, 22 Nov 2014 00:43:16 +0000 (00:43 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Sat, 22 Nov 2014 00:43:16 +0000 (00:43 +0000)
Far better to optimise usercopy functions if you need to

Kernel/mm.c

index 8e722f6..c8269fa 100644 (file)
@@ -2,19 +2,9 @@
 #include <kdata.h>
 #include <printf.h>
 
-/* Will move into arch code: for most platforms is a 'don't care' as
-   switching is cheap */
-#define is_common(a,b) (udata.u_base >= (char *) PROGTOP)
-
-/*
- * If System is in context or destination is in Common memory
- * (F000-FFFF is always in context), simply copy the data.
- * Otherwise perform Interbank move (uput) to User bank.
- */
-
 unsigned int uputsys(unsigned char *from, unsigned int size)
 {
-       if (udata.u_sysio || is_common(from, size))
+       if (udata.u_sysio)
                memcpy(udata.u_base, from, size);
        else
                uput(from, udata.u_base, size);
@@ -23,7 +13,7 @@ unsigned int uputsys(unsigned char *from, unsigned int size)
 
 unsigned int ugetsys(unsigned char *to, unsigned int size)
 {
-       if (udata.u_sysio || is_common(from, size))
+       if (udata.u_sysio)
                memcpy(to, udata.u_base, size);
        else
                uget(udata.u_base, to, size);