no need for linted annotations

This commit is contained in:
christos 2012-03-21 14:03:06 +00:00
parent 9d83720ae0
commit db0b896367
2 changed files with 13 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: _lwp.c,v 1.6 2012/03/21 09:05:35 bsh Exp $ */
/* $NetBSD: _lwp.c,v 1.7 2012/03/21 14:03:06 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: _lwp.c,v 1.6 2012/03/21 09:05:35 bsh Exp $");
__RCSID("$NetBSD: _lwp.c,v 1.7 2012/03/21 14:03:06 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -58,22 +58,15 @@ _lwp_makecontext(ucontext_t *u, void (*start)(void *),
u->uc_stack.ss_sp = stack_base;
u->uc_stack.ss_size = stack_size;
/* LINTED - alignment is fixed below. */
sp = (void **) (stack_base + stack_size);
sp = (void *) (stack_base + stack_size);
/*
* Note: We make sure the stack is 8-byte aligned, here.
*/
/* LINTED - doesn't lose any bits by this conversion */
u->uc_mcontext.__gregs[_REG_R0] = (__greg_t) arg;
/* LINTED - doesn't lose any bits by this conversion */
u->uc_mcontext.__gregs[_REG_SP] = ((__greg_t) sp) & ~7;
/* LINTED - doesn't lose any bits by this conversion */
u->uc_mcontext.__gregs[_REG_LR] = (__greg_t) _lwp_exit;
/* LINTED - doesn't lose any bits by this conversion */
u->uc_mcontext.__gregs[_REG_PC] = (__greg_t) start;
/* LINTED - unsinged long and unsigned int are same size */
u->uc_mcontext._mc_tlsbase = (uintptr_t)private;
u->uc_mcontext.__gregs[_REG_R0] = (__greg_t)(uintptr_t)arg;
u->uc_mcontext.__gregs[_REG_SP] = ((__greg_t)(uintptr_t)sp) & ~7;
u->uc_mcontext.__gregs[_REG_LR] = (__greg_t)(uintptr_t)_lwp_exit;
u->uc_mcontext.__gregs[_REG_PC] = (__greg_t)(uintptr_t)start;
u->uc_mcontext._mc_tlsbase = (__greg_t)(uintptr_t)private;
u->uc_flags |= _UC_TLSBASE;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: makecontext.c,v 1.3 2008/04/28 20:22:55 martin Exp $ */
/* $NetBSD: makecontext.c,v 1.4 2012/03/21 14:03:06 christos Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: makecontext.c,v 1.3 2008/04/28 20:22:55 martin Exp $");
__RCSID("$NetBSD: makecontext.c,v 1.4 2012/03/21 14:03:06 christos Exp $");
#endif
#include <stddef.h>
@ -55,12 +55,12 @@ makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
/* Allocate necessary stack space for arguments exceeding r0-3. */
if (argc > 4)
sp -= argc - 4;
gr[_REG_SP] = (__greg_t)sp;
gr[_REG_SP] = (__greg_t)(uintptr_t)sp;
/* Wipe out frame pointer. */
gr[_REG_FP] = 0;
/* Arrange for return via the trampoline code. */
gr[_REG_LR] = (__greg_t)_resumecontext;
gr[_REG_PC] = (__greg_t)func;
gr[_REG_LR] = (__greg_t)(uintptr_t)_resumecontext;
gr[_REG_PC] = (__greg_t)(uintptr_t)func;
va_start(ap, argc);
/* Pass up to four arguments in r0-3. */