/*
- * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
int
i386_set_ldt(
- int *retval,
+ uint32_t *retval,
uint32_t start_sel,
uint32_t descs, /* out */
uint32_t num_sels)
&& (start_sel < min_selector || start_sel >= LDTSZ))
return EINVAL;
if (start_sel != LDT_AUTO_ALLOC
- && start_sel + num_sels > LDTSZ)
+ && (uint64_t)start_sel + (uint64_t)num_sels > LDTSZ) /* cast to uint64_t to detect wrap-around */
return EINVAL;
task_lock(task);
int
i386_get_ldt(
- int *retval,
+ uint32_t *retval,
uint32_t start_sel,
uint32_t descs, /* out */
uint32_t num_sels)