From 2c5337a24f7f2d02989dfb733c55d6d8c7e90493 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sun, 29 Oct 2023 13:07:40 -0400 Subject: Update includes to L4T r32.7.4 and drop nvgpu/gk20a.h dependency Also add instructions for updating `include/`. These files are now only needed to build on Linux 4.9-based Tegra platforms. --- include/nvgpu/bug.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'include/nvgpu/bug.h') diff --git a/include/nvgpu/bug.h b/include/nvgpu/bug.h index 3d139b7..82d641b 100644 --- a/include/nvgpu/bug.h +++ b/include/nvgpu/bug.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -24,6 +24,24 @@ #ifdef __KERNEL__ #include +/* + * Define an assert macro that code within nvgpu can use. + * + * The goal of this macro is for debugging but what that means varies from OS + * to OS. On Linux wee don't want to BUG() for general driver misbehaving. BUG() + * is a very heavy handed tool - in fact there's probably no where within the + * nvgpu core code where it makes sense to use a BUG() when running under Linux. + * + * However, on QNX (and POSIX) BUG() will just kill the current process. This + * means we can use it for handling bugs in nvgpu. + * + * As a result this macro varies depending on platform. + */ +#define nvgpu_assert(cond) ((void) WARN_ON(!(cond))) +#define nvgpu_do_assert_print(g, fmt, arg...) \ + do { \ + nvgpu_err(g, fmt, ##arg); \ + } while (false) #elif defined(__NVGPU_POSIX__) #include #else -- cgit v1.2.2