The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/msan.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: msan.h,v 1.2 2020/09/09 16:29:59 maxv Exp $    */
    2 
    3 /*
    4  * Copyright (c) 2019-2020 Maxime Villard, m00nbsd.net
    5  * All rights reserved.
    6  *
    7  * This code is part of the KMSAN subsystem of the NetBSD kernel.
    8  *
    9  * Redistribution and use in source and binary forms, with or without
   10  * modification, are permitted provided that the following conditions
   11  * are met:
   12  * 1. Redistributions of source code must retain the above copyright
   13  *    notice, this list of conditions and the following disclaimer.
   14  * 2. Redistributions in binary form must reproduce the above copyright
   15  *    notice, this list of conditions and the following disclaimer in the
   16  *    documentation and/or other materials provided with the distribution.
   17  *
   18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   21  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   23  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   24  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
   25  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   26  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   28  * SUCH DAMAGE.
   29  */
   30 
   31 #ifndef _SYS_MSAN_H_
   32 #define _SYS_MSAN_H_
   33 
   34 #ifdef KMSAN
   35 #include <sys/_bus_dma.h>
   36 #include <sys/types.h>
   37 
   38 #define KMSAN_STATE_UNINIT      0xFF
   39 #define KMSAN_STATE_INITED      0x00
   40 
   41 #define KMSAN_TYPE_STACK        0
   42 #define KMSAN_TYPE_KMEM         1
   43 #define KMSAN_TYPE_MALLOC       2
   44 #define KMSAN_TYPE_UMA          3
   45 #define KMSAN_TYPE_MAX          3
   46 
   47 #define KMSAN_RET_ADDR          (uintptr_t)__builtin_return_address(0)
   48 
   49 union ccb;
   50 struct bio;
   51 struct mbuf;
   52 struct memdesc;
   53 
   54 void kmsan_init(void);
   55 
   56 void kmsan_shadow_map(vm_offset_t, size_t);
   57 
   58 void kmsan_thread_alloc(struct thread *);
   59 void kmsan_thread_free(struct thread *);
   60 
   61 void kmsan_bus_dmamap_sync(struct memdesc *, bus_dmasync_op_t);
   62 
   63 void kmsan_orig(const void *, size_t, int, uintptr_t);
   64 void kmsan_mark(const void *, size_t, uint8_t);
   65 void kmsan_mark_bio(const struct bio *, uint8_t);
   66 void kmsan_mark_mbuf(const struct mbuf *, uint8_t);
   67 
   68 void kmsan_check(const void *, size_t, const char *);
   69 void kmsan_check_bio(const struct bio *, const char *);
   70 void kmsan_check_ccb(const union ccb *, const char *);
   71 void kmsan_check_mbuf(const struct mbuf *, const char *);
   72 
   73 #else
   74 #define kmsan_init(u)
   75 #define kmsan_shadow_map(a, s)
   76 #define kmsan_thread_alloc(td)
   77 #define kmsan_thread_free(l)
   78 #define kmsan_dma_sync(m, a, s, o)
   79 #define kmsan_dma_load(m, b, s, o)
   80 #define kmsan_orig(p, l, c, a)
   81 #define kmsan_mark(p, l, c)
   82 #define kmsan_mark_bio(b, c)
   83 #define kmsan_mark_mbuf(m, c)
   84 #define kmsan_check(b, s, d)
   85 #define kmsan_check_bio(b, d)
   86 #define kmsan_check_ccb(c, d)
   87 #define kmsan_check_mbuf(m, d)
   88 #define kmsan_bus_dmamap_sync(d, op)
   89 #endif
   90 
   91 #endif /* !_SYS_MSAN_H_ */

Cache object: fd90514a0223573a0c281b41776f9c6e


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.