git: b3195ed2a31f - main - xen: correct spacing in hypercall.h headers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 28 Nov 2023 13:38:32 UTC
The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=b3195ed2a31f5e6179db8ce96d4ef7dd3e87a537 commit b3195ed2a31f5e6179db8ce96d4ef7dd3e87a537 Author: Elliott Mitchell <ehem+freebsd@m5p.com> AuthorDate: 2022-03-07 23:32:17 +0000 Commit: Roger Pau Monné <royger@FreeBSD.org> CommitDate: 2023-11-28 11:23:18 +0000 xen: correct spacing in hypercall.h headers A precursor to merging them. The spacing differs quite a bit between the i386 and amd64 hypercall headers, despite very similar content. Consistently use tabs instead of spaces. Reviewed by: royger --- sys/amd64/include/xen/hypercall.h | 56 ++++++------- sys/i386/include/xen/hypercall.h | 172 +++++++++++++++++++------------------- 2 files changed, 114 insertions(+), 114 deletions(-) diff --git a/sys/amd64/include/xen/hypercall.h b/sys/amd64/include/xen/hypercall.h index b09142af3f44..f62250679f0f 100644 --- a/sys/amd64/include/xen/hypercall.h +++ b/sys/amd64/include/xen/hypercall.h @@ -1,30 +1,30 @@ /****************************************************************************** * hypercall.h - * + * * FreeBSD-specific hypervisor handling. - * + * * Copyright (c) 2002-2004, K A Fraser - * + * * 64-bit updates: * Benjamin Liu <benjamin.liu@intel.com> * Jun Nakajima <jun.nakajima@intel.com> - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation; or, when distributed * separately from the Linux kernel or incorporated into other * software packages, subject to the following license: - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this source file (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 @@ -52,22 +52,22 @@ extern char *hypercall_page; #define HYPERCALL_STR(name) \ "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)" -#define _hypercall0(type, name) \ -({ \ - type __res; \ - __asm__ volatile ( \ - HYPERCALL_STR(name) \ - : "=a" (__res) \ - : \ - : "memory" ); \ - __res; \ +#define _hypercall0(type, name) \ +({ \ + type __res; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res) \ + : \ + : "memory" ); \ + __res; \ }) #define _hypercall1(type, name, a1) \ ({ \ type __res; \ long __ign1; \ - __asm__ volatile ( \ + __asm__ volatile ( \ HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1) \ : "1" ((long)(a1)) \ @@ -79,7 +79,7 @@ extern char *hypercall_page; ({ \ type __res; \ long __ign1, __ign2; \ - __asm__ volatile ( \ + __asm__ volatile ( \ HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1), "=S" (__ign2) \ : "1" ((long)(a1)), "2" ((long)(a2)) \ @@ -91,9 +91,9 @@ extern char *hypercall_page; ({ \ type __res; \ long __ign1, __ign2, __ign3; \ - __asm__ volatile ( \ + __asm__ volatile ( \ HYPERCALL_STR(name) \ - : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \ + : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \ "=d" (__ign3) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ "3" ((long)(a3)) \ @@ -105,8 +105,8 @@ extern char *hypercall_page; ({ \ type __res; \ long __ign1, __ign2, __ign3; \ - register long __arg4 __asm__("r10") = (long)(a4); \ - __asm__ volatile ( \ + register long __arg4 __asm__("r10") = (long)(a4); \ + __asm__ volatile ( \ HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \ "=d" (__ign3), "+r" (__arg4) \ @@ -120,9 +120,9 @@ extern char *hypercall_page; ({ \ type __res; \ long __ign1, __ign2, __ign3; \ - register long __arg4 __asm__("r10") = (long)(a4); \ - register long __arg5 __asm__("r8") = (long)(a5); \ - __asm__ volatile ( \ + register long __arg4 __asm__("r10") = (long)(a4); \ + register long __arg5 __asm__("r8") = (long)(a5); \ + __asm__ volatile ( \ HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \ "=d" (__ign3), "+r" (__arg4), "+r" (__arg5) \ @@ -194,7 +194,7 @@ HYPERVISOR_stack_switch( static inline int __must_check HYPERVISOR_set_callbacks( - unsigned long event_address, unsigned long failsafe_address, + unsigned long event_address, unsigned long failsafe_address, unsigned long syscall_address) { return _hypercall3(int, set_callbacks, @@ -350,9 +350,9 @@ HYPERVISOR_suspend( static inline unsigned long __must_check HYPERVISOR_hvm_op( - int op, void *arg) + int op, void *arg) { - return _hypercall2(unsigned long, hvm_op, op, arg); + return _hypercall2(unsigned long, hvm_op, op, arg); } static inline int __must_check diff --git a/sys/i386/include/xen/hypercall.h b/sys/i386/include/xen/hypercall.h index ff96cb93157c..94bb42e38a39 100644 --- a/sys/i386/include/xen/hypercall.h +++ b/sys/i386/include/xen/hypercall.h @@ -1,23 +1,23 @@ /****************************************************************************** * hypercall.h - * + * * Linux-specific hypervisor handling. - * + * * Copyright (c) 2002-2004, K A Fraser - * + * * This file may be distributed separately from the Linux kernel, or * incorporated into other software packages, subject to the following license: - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this source file (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 @@ -39,81 +39,81 @@ extern char *hypercall_page; #define __STR(x) #x #define STR(x) __STR(x) -#define HYPERCALL_STR(name) \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)" - -#define _hypercall0(type, name) \ -({ \ - long __res; \ - __asm__ volatile ( \ - HYPERCALL_STR(name) \ - : "=a" (__res) \ - : \ - : "memory" ); \ - (type)__res; \ +#define HYPERCALL_STR(name) \ + "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)" + +#define _hypercall0(type, name) \ +({ \ + long __res; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res) \ + : \ + : "memory" ); \ + (type)__res; \ }) -#define _hypercall1(type, name, a1) \ -({ \ - long __res, __ign1; \ - __asm__ volatile ( \ - HYPERCALL_STR(name) \ - : "=a" (__res), "=b" (__ign1) \ - : "1" ((long)(a1)) \ - : "memory" ); \ - (type)__res; \ +#define _hypercall1(type, name, a1) \ +({ \ + long __res, __ign1; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1) \ + : "1" ((long)(a1)) \ + : "memory" ); \ + (type)__res; \ }) -#define _hypercall2(type, name, a1, a2) \ -({ \ - long __res, __ign1, __ign2; \ - __asm__ volatile ( \ - HYPERCALL_STR(name) \ - : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \ - : "1" ((long)(a1)), "2" ((long)(a2)) \ - : "memory" ); \ - (type)__res; \ +#define _hypercall2(type, name, a1, a2) \ +({ \ + long __res, __ign1, __ign2; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \ + : "1" ((long)(a1)), "2" ((long)(a2)) \ + : "memory" ); \ + (type)__res; \ }) -#define _hypercall3(type, name, a1, a2, a3) \ -({ \ - long __res, __ign1, __ign2, __ign3; \ - __asm__ volatile ( \ - HYPERCALL_STR(name) \ - : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ - "=d" (__ign3) \ - : "1" ((long)(a1)), "2" ((long)(a2)), \ - "3" ((long)(a3)) \ - : "memory" ); \ - (type)__res; \ +#define _hypercall3(type, name, a1, a2, a3) \ +({ \ + long __res, __ign1, __ign2, __ign3; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ + "=d" (__ign3) \ + : "1" ((long)(a1)), "2" ((long)(a2)), \ + "3" ((long)(a3)) \ + : "memory" ); \ + (type)__res; \ }) -#define _hypercall4(type, name, a1, a2, a3, a4) \ -({ \ - long __res, __ign1, __ign2, __ign3, __ign4; \ - __asm__ volatile ( \ - HYPERCALL_STR(name) \ - : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ - "=d" (__ign3), "=S" (__ign4) \ - : "1" ((long)(a1)), "2" ((long)(a2)), \ - "3" ((long)(a3)), "4" ((long)(a4)) \ - : "memory" ); \ - (type)__res; \ +#define _hypercall4(type, name, a1, a2, a3, a4) \ +({ \ + long __res, __ign1, __ign2, __ign3, __ign4; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ + "=d" (__ign3), "=S" (__ign4) \ + : "1" ((long)(a1)), "2" ((long)(a2)), \ + "3" ((long)(a3)), "4" ((long)(a4)) \ + : "memory" ); \ + (type)__res; \ }) -#define _hypercall5(type, name, a1, a2, a3, a4, a5) \ -({ \ - long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \ - __asm__ volatile ( \ - HYPERCALL_STR(name) \ - : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ - "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \ - : "1" ((long)(a1)), "2" ((long)(a2)), \ - "3" ((long)(a3)), "4" ((long)(a4)), \ - "5" ((long)(a5)) \ - : "memory" ); \ - (type)__res; \ -}) +#define _hypercall5(type, name, a1, a2, a3, a4, a5) \ +({ \ + long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \ + __asm__ volatile ( \ + HYPERCALL_STR(name) \ + : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ + "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \ + : "1" ((long)(a1)), "2" ((long)(a2)), \ + "3" ((long)(a3)), "4" ((long)(a4)), \ + "5" ((long)(a5)) \ + : "memory" ); \ + (type)__res; \ +}) static inline long privcmd_hypercall(long op, long a1, long a2, long a3, long a4, long a5) @@ -127,10 +127,10 @@ privcmd_hypercall(long op, long a1, long a2, long a3, long a4, long a5) __asm__ volatile ( "call *%[call]" : "=a" (__res), "=b" (__ign1), "=c" (__ign2), - "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) - : "1" ((long)(a1)), "2" ((long)(a2)), - "3" ((long)(a3)), "4" ((long)(a4)), - "5" ((long)(a5)), [call] "a" (__call) + "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) + : "1" ((long)(a1)), "2" ((long)(a2)), + "3" ((long)(a3)), "4" ((long)(a4)), + "5" ((long)(a5)), [call] "a" (__call) : "memory" ); return __res; @@ -206,10 +206,10 @@ HYPERVISOR_set_timer_op( static inline int HYPERVISOR_platform_op( - struct xen_platform_op *platform_op) + struct xen_platform_op *platform_op) { - platform_op->interface_version = XENPF_INTERFACE_VERSION; - return _hypercall1(int, platform_op, platform_op); + platform_op->interface_version = XENPF_INTERFACE_VERSION; + return _hypercall1(int, platform_op, platform_op); } static inline int @@ -336,30 +336,30 @@ HYPERVISOR_suspend( static inline int HYPERVISOR_callback_op( - int cmd, void *arg) + int cmd, void *arg) { - return _hypercall2(int, callback_op, cmd, arg); + return _hypercall2(int, callback_op, cmd, arg); } static inline unsigned long HYPERVISOR_hvm_op( - int op, void *arg) + int op, void *arg) { - return _hypercall2(unsigned long, hvm_op, op, arg); + return _hypercall2(unsigned long, hvm_op, op, arg); } static inline int HYPERVISOR_xenoprof_op( - int op, void *arg) + int op, void *arg) { - return _hypercall2(int, xenoprof_op, op, arg); + return _hypercall2(int, xenoprof_op, op, arg); } static inline int HYPERVISOR_kexec_op( - unsigned long op, void *args) + unsigned long op, void *args) { - return _hypercall2(int, kexec_op, op, args); + return _hypercall2(int, kexec_op, op, args); } static inline int