12 static int validate_memory_access_address(
unsigned long addr,
int size)
14 if (size < 0 || addr == 0)
21 unsigned long lsrc = (
unsigned long)src;
24 mem_type = validate_memory_access_address(lsrc, size);
29 if (size == 2 && lsrc % 2 == 0) {
31 memcpy(dst, &mmr,
sizeof(mmr));
33 }
else if (size == 4 && lsrc % 4 == 0) {
35 memcpy(dst, &mmr,
sizeof(mmr));
60 unsigned long ldst = (
unsigned long)dst;
63 mem_type = validate_memory_access_address(ldst, size);
68 if (size == 2 && ldst % 2 == 0) {
70 memcpy(&mmr, src,
sizeof(mmr));
73 }
else if (size == 4 && ldst % 4 == 0) {
75 memcpy(&mmr, src,
sizeof(mmr));