Add some notes on using these shims to port Linux kernel code.
This commit is contained in:
parent
b01a0aea47
commit
29a70da5ff
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: completion.h,v 1.3 2014/05/05 15:59:11 skrll Exp $ */
|
||||
/* $NetBSD: completion.h,v 1.4 2014/07/03 20:48:19 riastradh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2013 The NetBSD Foundation, Inc.
|
||||
@ -29,6 +29,20 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Notes on porting:
|
||||
*
|
||||
* - Linux does not have destroy_completion. You must add it yourself
|
||||
* in the appropriate place.
|
||||
*
|
||||
* - Some Linux code does `completion->done++' or similar. Convert
|
||||
* that to complete(completion) and suggest the same change upstream,
|
||||
* unless it turns out there actually is a good reason to do that, in
|
||||
* which case the Linux completion API should be extended with a
|
||||
* sensible name for this that doesn't expose the guts of `struct
|
||||
* completion'.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_COMPLETION_H_
|
||||
#define _LINUX_COMPLETION_H_
|
||||
|
||||
|
11
sys/external/bsd/common/include/linux/errno.h
vendored
11
sys/external/bsd/common/include/linux/errno.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: errno.h,v 1.1 2014/04/07 11:55:29 riastradh Exp $ */
|
||||
/* $NetBSD: errno.h,v 1.2 2014/07/03 20:48:19 riastradh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2013 The NetBSD Foundation, Inc.
|
||||
@ -29,6 +29,15 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Notes on porting:
|
||||
*
|
||||
* - Linux consistently passes around negative errno values. NetBSD
|
||||
* consistently passes around positive ones, except the special magic
|
||||
* in-kernel ones (EJUSTRETURN, ERESTART, &c.) which should not be
|
||||
* exposed to userland. Be careful!
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ERRNO_H_
|
||||
#define _LINUX_ERRNO_H_
|
||||
|
||||
|
14
sys/external/bsd/common/include/linux/list.h
vendored
14
sys/external/bsd/common/include/linux/list.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: list.h,v 1.1 2013/09/05 15:28:07 skrll Exp $ */
|
||||
/* $NetBSD: list.h,v 1.2 2014/07/03 20:48:19 riastradh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2013 The NetBSD Foundation, Inc.
|
||||
@ -29,6 +29,18 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Notes on porting:
|
||||
*
|
||||
* - LIST_HEAD(x) means a declaration `struct list_head x =
|
||||
* LIST_HEAD_INIT(x)' in Linux, but something else in NetBSD.
|
||||
* Replace by the expansion.
|
||||
*
|
||||
* - The `_rcu' routines here are not actually pserialize(9)-safe.
|
||||
* They need dependent read memory barriers added. Please fix this
|
||||
* if you need to use them with pserialize(9).
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_LIST_H_
|
||||
#define _LINUX_LIST_H_
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user