|
@@ -5050,8 +5050,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
{
|
|
{
|
|
void *gspec = argptr;
|
|
void *gspec = argptr;
|
|
void *cur_data = host_data;
|
|
void *cur_data = host_data;
|
|
- const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
|
|
|
|
- int spec_size = thunk_type_size(arg_type, 0);
|
|
|
|
|
|
+ const argtype dm_arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
|
|
|
|
+ int spec_size = thunk_type_size(dm_arg_type, 0);
|
|
int i;
|
|
int i;
|
|
|
|
|
|
for (i = 0; i < host_dm->target_count; i++) {
|
|
for (i = 0; i < host_dm->target_count; i++) {
|
|
@@ -5059,7 +5059,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
uint32_t next;
|
|
uint32_t next;
|
|
int slen;
|
|
int slen;
|
|
|
|
|
|
- thunk_convert(spec, gspec, arg_type, THUNK_HOST);
|
|
|
|
|
|
+ thunk_convert(spec, gspec, dm_arg_type, THUNK_HOST);
|
|
slen = strlen((char*)gspec + spec_size) + 1;
|
|
slen = strlen((char*)gspec + spec_size) + 1;
|
|
next = spec->next;
|
|
next = spec->next;
|
|
spec->next = sizeof(*spec) + slen;
|
|
spec->next = sizeof(*spec) + slen;
|
|
@@ -5099,7 +5099,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
struct dm_name_list *nl = (void*)host_dm + host_dm->data_start;
|
|
struct dm_name_list *nl = (void*)host_dm + host_dm->data_start;
|
|
uint32_t remaining_data = guest_data_size;
|
|
uint32_t remaining_data = guest_data_size;
|
|
void *cur_data = argptr;
|
|
void *cur_data = argptr;
|
|
- const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_name_list) };
|
|
|
|
|
|
+ const argtype dm_arg_type[] = { MK_STRUCT(STRUCT_dm_name_list) };
|
|
int nl_size = 12; /* can't use thunk_size due to alignment */
|
|
int nl_size = 12; /* can't use thunk_size due to alignment */
|
|
|
|
|
|
while (1) {
|
|
while (1) {
|
|
@@ -5111,7 +5111,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
host_dm->flags |= DM_BUFFER_FULL_FLAG;
|
|
host_dm->flags |= DM_BUFFER_FULL_FLAG;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- thunk_convert(cur_data, nl, arg_type, THUNK_TARGET);
|
|
|
|
|
|
+ thunk_convert(cur_data, nl, dm_arg_type, THUNK_TARGET);
|
|
strcpy(cur_data + nl_size, nl->name);
|
|
strcpy(cur_data + nl_size, nl->name);
|
|
cur_data += nl->next;
|
|
cur_data += nl->next;
|
|
remaining_data -= nl->next;
|
|
remaining_data -= nl->next;
|
|
@@ -5127,8 +5127,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
{
|
|
{
|
|
struct dm_target_spec *spec = (void*)host_dm + host_dm->data_start;
|
|
struct dm_target_spec *spec = (void*)host_dm + host_dm->data_start;
|
|
void *cur_data = argptr;
|
|
void *cur_data = argptr;
|
|
- const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
|
|
|
|
- int spec_size = thunk_type_size(arg_type, 0);
|
|
|
|
|
|
+ const argtype dm_arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
|
|
|
|
+ int spec_size = thunk_type_size(dm_arg_type, 0);
|
|
int i;
|
|
int i;
|
|
|
|
|
|
for (i = 0; i < host_dm->target_count; i++) {
|
|
for (i = 0; i < host_dm->target_count; i++) {
|
|
@@ -5139,7 +5139,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
host_dm->flags |= DM_BUFFER_FULL_FLAG;
|
|
host_dm->flags |= DM_BUFFER_FULL_FLAG;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- thunk_convert(cur_data, spec, arg_type, THUNK_TARGET);
|
|
|
|
|
|
+ thunk_convert(cur_data, spec, dm_arg_type, THUNK_TARGET);
|
|
strcpy(cur_data + spec_size, (char*)&spec[1]);
|
|
strcpy(cur_data + spec_size, (char*)&spec[1]);
|
|
cur_data = argptr + spec->next;
|
|
cur_data = argptr + spec->next;
|
|
spec = (void*)host_dm + host_dm->data_start + next;
|
|
spec = (void*)host_dm + host_dm->data_start + next;
|
|
@@ -5167,8 +5167,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
struct dm_target_versions *vers = (void*)host_dm + host_dm->data_start;
|
|
struct dm_target_versions *vers = (void*)host_dm + host_dm->data_start;
|
|
uint32_t remaining_data = guest_data_size;
|
|
uint32_t remaining_data = guest_data_size;
|
|
void *cur_data = argptr;
|
|
void *cur_data = argptr;
|
|
- const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_target_versions) };
|
|
|
|
- int vers_size = thunk_type_size(arg_type, 0);
|
|
|
|
|
|
+ const argtype dm_arg_type[] = { MK_STRUCT(STRUCT_dm_target_versions) };
|
|
|
|
+ int vers_size = thunk_type_size(dm_arg_type, 0);
|
|
|
|
|
|
while (1) {
|
|
while (1) {
|
|
uint32_t next = vers->next;
|
|
uint32_t next = vers->next;
|
|
@@ -5179,7 +5179,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
host_dm->flags |= DM_BUFFER_FULL_FLAG;
|
|
host_dm->flags |= DM_BUFFER_FULL_FLAG;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- thunk_convert(cur_data, vers, arg_type, THUNK_TARGET);
|
|
|
|
|
|
+ thunk_convert(cur_data, vers, dm_arg_type, THUNK_TARGET);
|
|
strcpy(cur_data + vers_size, vers->name);
|
|
strcpy(cur_data + vers_size, vers->name);
|
|
cur_data += vers->next;
|
|
cur_data += vers->next;
|
|
remaining_data -= vers->next;
|
|
remaining_data -= vers->next;
|
|
@@ -11177,14 +11177,14 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
|
}
|
|
}
|
|
case TARGET_NR_getcpu:
|
|
case TARGET_NR_getcpu:
|
|
{
|
|
{
|
|
- unsigned cpu, node;
|
|
|
|
- ret = get_errno(sys_getcpu(arg1 ? &cpu : NULL,
|
|
|
|
|
|
+ unsigned cpuid, node;
|
|
|
|
+ ret = get_errno(sys_getcpu(arg1 ? &cpuid : NULL,
|
|
arg2 ? &node : NULL,
|
|
arg2 ? &node : NULL,
|
|
NULL));
|
|
NULL));
|
|
if (is_error(ret)) {
|
|
if (is_error(ret)) {
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
- if (arg1 && put_user_u32(cpu, arg1)) {
|
|
|
|
|
|
+ if (arg1 && put_user_u32(cpuid, arg1)) {
|
|
return -TARGET_EFAULT;
|
|
return -TARGET_EFAULT;
|
|
}
|
|
}
|
|
if (arg2 && put_user_u32(node, arg2)) {
|
|
if (arg2 && put_user_u32(node, arg2)) {
|
|
@@ -12339,7 +12339,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
|
case TARGET_NR_listxattr:
|
|
case TARGET_NR_listxattr:
|
|
case TARGET_NR_llistxattr:
|
|
case TARGET_NR_llistxattr:
|
|
{
|
|
{
|
|
- void *p, *b = 0;
|
|
|
|
|
|
+ void *b = 0;
|
|
if (arg2) {
|
|
if (arg2) {
|
|
b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
|
|
b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
|
|
if (!b) {
|
|
if (!b) {
|
|
@@ -12376,7 +12376,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
|
case TARGET_NR_setxattr:
|
|
case TARGET_NR_setxattr:
|
|
case TARGET_NR_lsetxattr:
|
|
case TARGET_NR_lsetxattr:
|
|
{
|
|
{
|
|
- void *p, *n, *v = 0;
|
|
|
|
|
|
+ void *n, *v = 0;
|
|
if (arg3) {
|
|
if (arg3) {
|
|
v = lock_user(VERIFY_READ, arg3, arg4, 1);
|
|
v = lock_user(VERIFY_READ, arg3, arg4, 1);
|
|
if (!v) {
|
|
if (!v) {
|
|
@@ -12421,7 +12421,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
|
case TARGET_NR_getxattr:
|
|
case TARGET_NR_getxattr:
|
|
case TARGET_NR_lgetxattr:
|
|
case TARGET_NR_lgetxattr:
|
|
{
|
|
{
|
|
- void *p, *n, *v = 0;
|
|
|
|
|
|
+ void *n, *v = 0;
|
|
if (arg3) {
|
|
if (arg3) {
|
|
v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
|
|
v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
|
|
if (!v) {
|
|
if (!v) {
|
|
@@ -12466,7 +12466,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
|
case TARGET_NR_removexattr:
|
|
case TARGET_NR_removexattr:
|
|
case TARGET_NR_lremovexattr:
|
|
case TARGET_NR_lremovexattr:
|
|
{
|
|
{
|
|
- void *p, *n;
|
|
|
|
|
|
+ void *n;
|
|
p = lock_user_string(arg1);
|
|
p = lock_user_string(arg1);
|
|
n = lock_user_string(arg2);
|
|
n = lock_user_string(arg2);
|
|
if (p && n) {
|
|
if (p && n) {
|