11.4Sriastrad/* $NetBSD: kthread.h,v 1.4 2021/12/19 12:42:25 riastradh Exp $ */ 21.2Sriastrad 31.2Sriastrad/*- 41.2Sriastrad * Copyright (c) 2013 The NetBSD Foundation, Inc. 51.2Sriastrad * All rights reserved. 61.2Sriastrad * 71.2Sriastrad * This code is derived from software contributed to The NetBSD Foundation 81.2Sriastrad * by Taylor R. Campbell. 91.2Sriastrad * 101.2Sriastrad * Redistribution and use in source and binary forms, with or without 111.2Sriastrad * modification, are permitted provided that the following conditions 121.2Sriastrad * are met: 131.2Sriastrad * 1. Redistributions of source code must retain the above copyright 141.2Sriastrad * notice, this list of conditions and the following disclaimer. 151.2Sriastrad * 2. Redistributions in binary form must reproduce the above copyright 161.2Sriastrad * notice, this list of conditions and the following disclaimer in the 171.2Sriastrad * documentation and/or other materials provided with the distribution. 181.2Sriastrad * 191.2Sriastrad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 201.2Sriastrad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 211.2Sriastrad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 221.2Sriastrad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 231.2Sriastrad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 241.2Sriastrad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 251.2Sriastrad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 261.2Sriastrad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 271.2Sriastrad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 281.2Sriastrad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 291.2Sriastrad * POSSIBILITY OF SUCH DAMAGE. 301.2Sriastrad */ 311.2Sriastrad 321.2Sriastrad#ifndef _LINUX_KTHREAD_H_ 331.2Sriastrad#define _LINUX_KTHREAD_H_ 341.2Sriastrad 351.4Sriastrad#include <linux/spinlock.h> 361.4Sriastrad 371.4Sriastrad#include <drm/drm_wait_netbsd.h> 381.4Sriastrad 391.3Sriastradstruct task_struct; 401.3Sriastrad 411.3Sriastrad#define __kthread_should_park linux___kthread_should_park 421.3Sriastrad#define kthread_park linux_kthread_park 431.3Sriastrad#define kthread_parkme linux_kthread_parkme 441.3Sriastrad#define kthread_run linux_kthread_run 451.3Sriastrad#define kthread_should_park linux_kthread_should_park 461.3Sriastrad#define kthread_should_stop linux_kthread_should_stop 471.3Sriastrad#define kthread_stop linux_kthread_stop 481.3Sriastrad#define kthread_unpark linux_kthread_unpark 491.3Sriastrad 501.4Sriastradstruct task_struct *kthread_run(int (*)(void *), void *, const char *, 511.4Sriastrad spinlock_t *, drm_waitqueue_t *); 521.3Sriastrad 531.3Sriastradint kthread_stop(struct task_struct *); 541.3Sriastradint kthread_should_stop(void); 551.3Sriastrad 561.3Sriastradvoid kthread_park(struct task_struct *); 571.3Sriastradvoid kthread_unpark(struct task_struct *); 581.3Sriastradint __kthread_should_park(struct task_struct *); 591.3Sriastradint kthread_should_park(void); 601.3Sriastradvoid kthread_parkme(void); 611.3Sriastrad 621.3Sriastradint linux_kthread_init(void); 631.3Sriastradvoid linux_kthread_fini(void); 641.3Sriastrad 651.2Sriastrad#endif /* _LINUX_KTHREAD_H_ */ 66