From acb59b9c204e92310e4cf4216e1bf2a2a3ac578a Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Fri, 11 Dec 2015 00:11:22 -0500 Subject: [PATCH] include: add macros to properly declare assembly functions/data Signed-off-by: Josef 'Jeff' Sipek --- include/asmlinkage.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 include/asmlinkage.h diff --git a/include/asmlinkage.h b/include/asmlinkage.h new file mode 100644 index 0000000..e2ad4b0 --- /dev/null +++ b/include/asmlinkage.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2015-2019 Josef 'Jeff' Sipek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef __ASMLINKAGE_H +#define __ASMLINKAGE_H + +#define ENTRY(name) \ + .text; \ + .globl name; \ + .align 4; \ + .type name,@function; \ + name: + +#define LDATA(name, a) \ + .data; \ + .align a; \ + .type name,@object; \ + name: + +#define GDATA(name, a) \ + .globl name; \ + LDATA(name, a) + +#define SET_SIZE(name) \ + .size name, .-name + +#endif -- 2.11.4.GIT