diff options
Diffstat (limited to 'kernel/compat.c')
-rw-r--r-- | kernel/compat.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/kernel/compat.c b/kernel/compat.c index c5620d6435e0..0a09e481b70b 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
@@ -1119,71 +1119,6 @@ asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, | |||
1119 | } | 1119 | } |
1120 | #endif | 1120 | #endif |
1121 | 1121 | ||
1122 | struct compat_sysinfo { | ||
1123 | s32 uptime; | ||
1124 | u32 loads[3]; | ||
1125 | u32 totalram; | ||
1126 | u32 freeram; | ||
1127 | u32 sharedram; | ||
1128 | u32 bufferram; | ||
1129 | u32 totalswap; | ||
1130 | u32 freeswap; | ||
1131 | u16 procs; | ||
1132 | u16 pad; | ||
1133 | u32 totalhigh; | ||
1134 | u32 freehigh; | ||
1135 | u32 mem_unit; | ||
1136 | char _f[20-2*sizeof(u32)-sizeof(int)]; | ||
1137 | }; | ||
1138 | |||
1139 | asmlinkage long | ||
1140 | compat_sys_sysinfo(struct compat_sysinfo __user *info) | ||
1141 | { | ||
1142 | struct sysinfo s; | ||
1143 | |||
1144 | do_sysinfo(&s); | ||
1145 | |||
1146 | /* Check to see if any memory value is too large for 32-bit and scale | ||
1147 | * down if needed | ||
1148 | */ | ||
1149 | if ((s.totalram >> 32) || (s.totalswap >> 32)) { | ||
1150 | int bitcount = 0; | ||
1151 | |||
1152 | while (s.mem_unit < PAGE_SIZE) { | ||
1153 | s.mem_unit <<= 1; | ||
1154 | bitcount++; | ||
1155 | } | ||
1156 | |||
1157 | s.totalram >>= bitcount; | ||
1158 | s.freeram >>= bitcount; | ||
1159 | s.sharedram >>= bitcount; | ||
1160 | s.bufferram >>= bitcount; | ||
1161 | s.totalswap >>= bitcount; | ||
1162 | s.freeswap >>= bitcount; | ||
1163 | s.totalhigh >>= bitcount; | ||
1164 | s.freehigh >>= bitcount; | ||
1165 | } | ||
1166 | |||
1167 | if (!access_ok(VERIFY_WRITE, info, sizeof(struct compat_sysinfo)) || | ||
1168 | __put_user (s.uptime, &info->uptime) || | ||
1169 | __put_user (s.loads[0], &info->loads[0]) || | ||
1170 | __put_user (s.loads[1], &info->loads[1]) || | ||
1171 | __put_user (s.loads[2], &info->loads[2]) || | ||
1172 | __put_user (s.totalram, &info->totalram) || | ||
1173 | __put_user (s.freeram, &info->freeram) || | ||
1174 | __put_user (s.sharedram, &info->sharedram) || | ||
1175 | __put_user (s.bufferram, &info->bufferram) || | ||
1176 | __put_user (s.totalswap, &info->totalswap) || | ||
1177 | __put_user (s.freeswap, &info->freeswap) || | ||
1178 | __put_user (s.procs, &info->procs) || | ||
1179 | __put_user (s.totalhigh, &info->totalhigh) || | ||
1180 | __put_user (s.freehigh, &info->freehigh) || | ||
1181 | __put_user (s.mem_unit, &info->mem_unit)) | ||
1182 | return -EFAULT; | ||
1183 | |||
1184 | return 0; | ||
1185 | } | ||
1186 | |||
1187 | COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval, | 1122 | COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval, |
1188 | compat_pid_t, pid, | 1123 | compat_pid_t, pid, |
1189 | struct compat_timespec __user *, interval) | 1124 | struct compat_timespec __user *, interval) |