/* * linux/arch/i386/kernel/i387.c * * Copyright (C) 1994 Linus Torvalds * * Pentium III FXSR, SSE support * General FPU state handling cleanups * Gareth Hughes , May 2000 */ #include #include #include #include void init_fpu(void) { __asm__ __volatile__ ( "fninit" ); if ( cpu_has_xmm ) load_mxcsr(0x1f80); set_bit(EDF_DONEFPUINIT, ¤t->flags); } void save_init_fpu(struct exec_domain *tsk) { /* * The guest OS may have set the 'virtual STTS' flag. * This causes us to set the real flag, so we'll need * to temporarily clear it while saving f-p state. */ if ( test_bit(EDF_GUEST_STTS, &tsk->flags) ) clts(); if ( cpu_has_fxsr ) __asm__ __volatile__ ( "fxsave %0 ; fnclex" : "=m" (tsk->arch.guest_context.fpu_ctxt) ); else __asm__ __volatile__ ( "fnsave %0 ; fwait" : "=m" (tsk->arch.guest_context.fpu_ctxt) ); clear_bit(EDF_USEDFPU, &tsk->flags); stts(); } void restore_fpu(struct exec_domain *tsk) { /* * FXRSTOR can fault if passed a corrupted data block. We handle this * possibility, which may occur if the block was passed to us by control * tools, by silently clearing the block. */ if ( cpu_has_fxsr ) __asm__ __volatile__ ( "1: fxrstor %0 \n" ".section .fixup,\"ax\" \n" "2: push %%"__OP"ax \n" " push %%"__OP"cx \n" " push %%"__OP"di \n" " lea %0,%%"__OP"di \n" " mov %1,%%ecx \n" " xor %%eax,%%eax \n" " rep ; stosl \n" " pop %%"__OP"di \n" " pop %%"__OP"cx \n" " pop %%"__OP"ax \n" " jmp 1b \n" ".previous \n" ".section __ex_table,\"a\"\n" " "__FIXUP_ALIGN" \n" " "__FIXUP_WORD" 1b,2b \n" ".previous \n" : : "m" (tsk->arch.guest_context.fpu_ctxt), "i" (sizeof(tsk->arch.guest_context.fpu_ctxt)/4) ); else __asm__ __volatile__ ( "frstor %0" : : "m" (tsk->arch.guest_context.fpu_ctxt) ); } /* * Local variables: * mode: C * c-set-style: "BSD" * c-basic-offset: 4 * tab-width: 4 * indent-tabs-mode: nil * End: */ class='path'>path: root/quantum/visualizer/lcd_keyframes.h
blob: 2e912b4c73d27ee703ee053a8e046331ffcec801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Copyright 2017 Fred Sundvik
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_
#define QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_

#include "visualizer.h"

// Displays the layer text centered vertically on the screen
bool lcd_keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays a bitmap (0/1) of all the currently active layers
bool lcd_keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays a bitmap (0/1) of all the currently active mods
bool lcd_keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays the keyboard led states (CAPS (Caps lock), NUM (Num lock), SCRL (Scroll lock), COMP (Compose), KANA)
bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays both the layer text and the led states
bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays the QMK logo on the LCD screen
bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state);

bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);


#endif /* QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_ */