aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/common/bootloader.h
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-04-06 02:11:55 +1000
committerGitHub <noreply@github.com>2020-04-05 18:11:55 +0200
commit6de77141a4f7d45b19a148674beba1beb6711472 (patch)
tree2e3a3628dae42232cbe93cf121ed2daa10906102 /tmk_core/common/bootloader.h
parent6f6c2e1c5c2e619aeec0d64a5a7156aed9fd559d (diff)
downloadfirmware-6de77141a4f7d45b19a148674beba1beb6711472.tar.gz
firmware-6de77141a4f7d45b19a148674beba1beb6711472.tar.bz2
firmware-6de77141a4f7d45b19a148674beba1beb6711472.zip
Doctor: Add avrdude/dfu-util/dfu-programmer version printing (#8678)
* Doctor: Add avrdude/dfu-util/dfu-programmer version printing * Extra newline * Iterate through version checking functions
Diffstat (limited to 'tmk_core/common/bootloader.h')
0 files changed, 0 insertions, 0 deletions
highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef __X86_BUG_H__
#define __X86_BUG_H__

#include <asm/x86_64/bug.h>

struct bug_frame {
    unsigned char ud2[2];
    unsigned char ret;
    unsigned short id; /* BUGFRAME_??? */
} __attribute__((packed));

#define BUGFRAME_run_fn 0
#define BUGFRAME_warn   1
#define BUGFRAME_bug    2
#define BUGFRAME_assert 3

#define run_in_exception_handler(fn)               \
    asm volatile (                                 \
        "ud2 ; ret %0" BUG_STR(1)                  \
        : : "i" (BUGFRAME_run_fn),                 \
            "i" (&(fn)) )

#define WARN()                                     \
    asm volatile (                                 \
        "ud2 ; ret %0" BUG_STR(1)                  \
        : : "i" (BUGFRAME_warn | (__LINE__<<2)),   \
            "i" (__FILE__) )

#define BUG()                                      \
    asm volatile (                                 \
        "ud2 ; ret %0" BUG_STR(1)                  \
        : : "i" (BUGFRAME_bug | (__LINE__<<2)),    \
            "i" (__FILE__) )

#define assert_failed(p)                           \
    asm volatile (                                 \
        "ud2 ; ret %0" BUG_STR(1) BUG_STR(2)       \
        : : "i" (BUGFRAME_assert | (__LINE__<<2)), \
            "i" (__FILE__), "i" (p) )


#endif /* __X86_BUG_H__ */