Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/asm/fpu/api.h
Show All 26 Lines | |||||
#ifndef _FPU_API_H_ | #ifndef _FPU_API_H_ | ||||
#define _FPU_API_H_ | #define _FPU_API_H_ | ||||
#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) | #if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) | ||||
#include <machine/fpu.h> | #include <machine/fpu.h> | ||||
extern struct fpu_kern_ctx *__lkpi_fpu_ctx; | /* Technically the Linux API isn't supposed to allow nesting sections either, | ||||
kib: Comment should follow style. | |||||
* but currently used versions of GPU drivers rely on nesting working, | |||||
* so we only enter the section on the outermost level. */ | |||||
extern unsigned int __lkpi_fpu_ctx_level; | extern unsigned int __lkpi_fpu_ctx_level; | ||||
static inline void | static inline void | ||||
kernel_fpu_begin() | kernel_fpu_begin() | ||||
kibUnsubmitted Not Done Inline ActionsUse ANSI C definitions. kib: Use ANSI C definitions. | |||||
val_packett.coolAuthorUnsubmitted Done Inline ActionsHuh? The only non-ANSI thing I know of is "K&R style" local variables being declared before the opening { bracket. But these functions do not declare any locals at all…?? val_packett.cool: Huh? The only non-ANSI thing I know of is "K&R style" local variables being declared before the… | |||||
val_packett.coolAuthorUnsubmitted Done Inline ActionsOh.. you mean the whole "blank () args doesn't mean no args" thing I guess val_packett.cool: Oh.. you mean the whole "blank `()` args doesn't mean no args" thing I guess | |||||
{ | { | ||||
if (__lkpi_fpu_ctx_level++ == 0) { | if (__lkpi_fpu_ctx_level++ == 0) { | ||||
kibUnsubmitted Not Done Inline ActionsThis is still completely melts if more than one thread does kernel_fpu_begin() kib: This is still completely melts if more than one thread does kernel_fpu_begin() | |||||
hselaskyUnsubmitted Not Done Inline ActionsFeel free to extend the LinuxKPI's "current" with this variable. hselasky: Feel free to extend the LinuxKPI's "current" with this variable. | |||||
val_packett.coolAuthorUnsubmitted Done Inline Actions
OH! Thanks, that makes sense now. Where was this comment when I posted the original patch ;) val_packett.cool: > Feel free to extend the LinuxKPI's "current" with this variable.
OH! Thanks, that makes… | |||||
fpu_kern_enter(curthread, __lkpi_fpu_ctx, FPU_KERN_NORMAL); | fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); | ||||
} | } | ||||
} | } | ||||
static inline void | static inline void | ||||
kernel_fpu_end() | kernel_fpu_end() | ||||
{ | { | ||||
if (--__lkpi_fpu_ctx_level == 0) { | if (--__lkpi_fpu_ctx_level == 0) { | ||||
fpu_kern_leave(curthread, __lkpi_fpu_ctx); | fpu_kern_leave(curthread, NULL); | ||||
} | } | ||||
} | } | ||||
#else | #else | ||||
static inline void | static inline void | ||||
kernel_fpu_begin() | kernel_fpu_begin() | ||||
{ | { | ||||
Show All 10 Lines |
Comment should follow style.