Changeset 001957b6 in mainline


Ignore:
Timestamp:
2023-10-26T20:20:55Z (13 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
0373af9
Parents:
2fbb42f
Message:

ccheck

Location:
kernel/generic
Files:
7 edited
18 moved

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/debug/constants.h

    r2fbb42f r001957b6  
    4545
    4646enum {
    47 #include "../debug/constants/dw_ut.h"
     47#include "constants/dw_ut.inc"
    4848
    4949        DW_UT_lo_user = 0x80,
     
    5252
    5353enum {
    54 #include "../debug/constants/dw_tag.h"
     54#include "constants/dw_tag.inc"
    5555
    5656        DW_TAG_lo_user = 0x4080,
     
    5959
    6060enum {
    61 #include "../debug/constants/dw_at.h"
     61#include "constants/dw_at.inc"
    6262
    6363        DW_AT_lo_user = 0x2000,
     
    6666
    6767enum {
    68 #include "../debug/constants/dw_form.h"
     68#include "constants/dw_form.inc"
    6969};
    7070
    7171enum {
    72 #include "../debug/constants/dw_op.h"
     72#include "constants/dw_op.inc"
    7373
    7474        DW_OP_lo_user = 0xe0,
     
    7777
    7878enum {
    79 #include "../debug/constants/dw_lle.h"
     79#include "constants/dw_lle.inc"
    8080};
    8181
    8282enum {
    83 #include "../debug/constants/dw_ate.h"
     83#include "constants/dw_ate.inc"
    8484
    8585        DW_ATE_lo_user = 0x80,
     
    8888
    8989enum {
    90 #include "../debug/constants/dw_ds.h"
     90#include "constants/dw_ds.inc"
    9191};
    9292
    9393enum {
    94 #include "../debug/constants/dw_end.h"
     94#include "constants/dw_end.inc"
    9595
    9696        DW_END_lo_user = 0x40,
     
    9999
    100100enum {
    101 #include "../debug/constants/dw_access.h"
     101#include "constants/dw_access.inc"
    102102};
    103103
    104104enum {
    105 #include "../debug/constants/dw_vis.h"
     105#include "constants/dw_vis.inc"
    106106};
    107107
    108108enum {
    109 #include "../debug/constants/dw_virtuality.h"
     109#include "constants/dw_virtuality.inc"
    110110};
    111111
    112112enum {
    113 #include "../debug/constants/dw_lang.h"
     113#include "constants/dw_lang.inc"
    114114
    115115        DW_LANG_lo_user = 0x8000,
     
    122122
    123123enum {
    124 #include "../debug/constants/dw_id.h"
     124#include "constants/dw_id.inc"
    125125};
    126126
    127127enum {
    128 #include "../debug/constants/dw_cc.h"
     128#include "constants/dw_cc.inc"
    129129
    130130        DW_CC_lo_user = 0x40,
     
    133133
    134134enum {
    135 #include "../debug/constants/dw_lns.h"
     135#include "constants/dw_lns.inc"
    136136};
    137137
    138138enum {
    139 #include "../debug/constants/dw_lne.h"
     139#include "constants/dw_lne.inc"
    140140
    141141        DW_LNE_lo_user = 0x80,
     
    144144
    145145enum {
    146 #include "../debug/constants/dw_lnct.h"
     146#include "constants/dw_lnct.inc"
    147147
    148148        DW_LNCT_lo_user = 0x2000,
  • kernel/generic/include/debug/line.h

    r2fbb42f r001957b6  
    9292static inline struct debug_line_program debug_line_program_create(const uint8_t *program,
    9393    const uint8_t *const program_end,
    94         const struct debug_line_program_header *hdr)
     94    const struct debug_line_program_header *hdr)
    9595{
    9696        return (struct debug_line_program) {
  • kernel/generic/src/debug/line.c

    r2fbb42f r001957b6  
    195195                case DW_LNS_advance_pc:
    196196                        arg = read_uleb128(&program, program_end);
    197                         DEBUGF("%s(%"PRIu64")\n", opname, arg);
     197                        DEBUGF("%s(%" PRIu64 ")\n", opname, arg);
    198198                        lp->op_advance += arg;
    199199                        break;
     
    267267                        case DW_LNE_set_discriminator:
    268268                                uint64_t arg = read_uleb128(&program, program_end);
    269                                 DEBUGF("%s:%zu(%"PRIu64")\n", opname, length, arg);
     269                                DEBUGF("%s:%zu(%" PRIu64 ")\n", opname, length, arg);
    270270                                break;
    271271
     
    369369
    370370                print_format("directory_entry_format",
    371                         hdr->v5.directory_entry_format, hdr->v5.directory_entry_format_end);
     371                    hdr->v5.directory_entry_format, hdr->v5.directory_entry_format_end);
    372372
    373373                FIELD(v5.directories_count, PRIu64, read_uleb128(&data, data_end));
     
    375375                hdr->v5.directories = data;
    376376                skip_formatted_list(&data, data_end, hdr->v5.directories_count,
    377                         hdr->v5.directory_entry_format, hdr->v5.directory_entry_format_end, width);
     377                    hdr->v5.directory_entry_format, hdr->v5.directory_entry_format_end, width);
    378378                hdr->v5.directories_end = data;
    379379
    380380                print_formatted_list("directories", hdr->v5.directories, hdr->v5.directories_end,
    381                         hdr->v5.directory_entry_format, hdr->v5.directory_entry_format_end, width);
     381                    hdr->v5.directory_entry_format, hdr->v5.directory_entry_format_end, width);
    382382
    383383                FIELD(v5.file_name_entry_format_count, "u", read_byte(&data, data_end));
     
    388388
    389389                print_format("file_name_entry_format",
    390                         hdr->v5.file_name_entry_format, hdr->v5.file_name_entry_format_end);
     390                    hdr->v5.file_name_entry_format, hdr->v5.file_name_entry_format_end);
    391391
    392392                FIELD(v5.file_names_count, PRIu64, read_uleb128(&data, data_end));
     
    394394                hdr->v5.file_names = data;
    395395                skip_formatted_list(&data, data_end, hdr->v5.file_names_count,
    396                         hdr->v5.file_name_entry_format, hdr->v5.file_name_entry_format_end, width);
     396                    hdr->v5.file_name_entry_format, hdr->v5.file_name_entry_format_end, width);
    397397                hdr->v5.file_names_end = data;
    398398
    399399                print_formatted_list("file_names", hdr->v5.file_names, hdr->v5.file_names_end,
    400                         hdr->v5.file_name_entry_format, hdr->v5.file_name_entry_format_end, width);
     400                    hdr->v5.file_name_entry_format, hdr->v5.file_name_entry_format_end, width);
    401401        }
    402402}
     
    655655
    656656                        /*
    657                         if (!lp.end_sequence) {
    658                                 debug_line_program_skip_to_sequence_end(&lp);
    659                                 assert(lp.truncated || lp.end_sequence);
    660                         }
    661                         */
     657                         * if (!lp.end_sequence) {
     658                         * debug_line_program_skip_to_sequence_end(&lp);
     659                         * assert(lp.truncated || lp.end_sequence);
     660                         * }
     661                         */
    662662                }
    663663        }
     
    666666}
    667667
    668 static bool get_info(const struct debug_line_program_header *hdr, uintptr_t addr, int op_index, int *file, int *line, int *column) {
     668static bool get_info(const struct debug_line_program_header *hdr, uintptr_t addr, int op_index, int *file, int *line, int *column)
     669{
    669670        struct debug_line_program lp = debug_line_program_create(
    670                 hdr->header_end, hdr->unit_end, hdr);
     671            hdr->header_end, hdr->unit_end, hdr);
    671672
    672673        int last_file = 0;
     
    735736        return true;
    736737}
    737 
  • kernel/generic/src/debug/names.c

    r2fbb42f r001957b6  
    3535
    3636static const char *const dw_ut_names[] = {
    37         #include <debug/constants/dw_ut.h>
     37#include <debug/constants/dw_ut.inc>
    3838};
    3939
    4040static const char *const dw_tag_names[] = {
    41         #include <debug/constants/dw_tag.h>
     41#include <debug/constants/dw_tag.inc>
    4242};
    4343
    4444static const char *const dw_at_names[] = {
    45         #include <debug/constants/dw_at.h>
     45#include <debug/constants/dw_at.inc>
    4646};
    4747
    4848static const char *const dw_form_names[] = {
    49         #include <debug/constants/dw_form.h>
     49#include <debug/constants/dw_form.inc>
    5050};
    5151
    5252static const char *const dw_op_names[] = {
    53         #include <debug/constants/dw_op.h>
     53#include <debug/constants/dw_op.inc>
    5454};
    5555
    5656static const char *const dw_lle_names[] = {
    57         #include <debug/constants/dw_lle.h>
     57#include <debug/constants/dw_lle.inc>
    5858};
    5959
    6060static const char *const dw_ate_names[] = {
    61         #include <debug/constants/dw_ate.h>
     61#include <debug/constants/dw_ate.inc>
    6262};
    6363
    6464static const char *const dw_ds_names[] = {
    65         #include <debug/constants/dw_ds.h>
     65#include <debug/constants/dw_ds.inc>
    6666};
    6767
    6868static const char *const dw_end_names[] = {
    69         #include <debug/constants/dw_end.h>
     69#include <debug/constants/dw_end.inc>
    7070};
    7171
    7272static const char *const dw_access_names[] = {
    73         #include <debug/constants/dw_access.h>
     73#include <debug/constants/dw_access.inc>
    7474};
    7575
    7676static const char *const dw_vis_names[] = {
    77         #include <debug/constants/dw_vis.h>
     77#include <debug/constants/dw_vis.inc>
    7878};
    7979
    8080static const char *const dw_virtuality_names[] = {
    81         #include <debug/constants/dw_virtuality.h>
     81#include <debug/constants/dw_virtuality.inc>
    8282};
    8383
    8484static const char *const dw_lang_names[] = {
    85         #include <debug/constants/dw_lang.h>
     85#include <debug/constants/dw_lang.inc>
    8686};
    8787
    8888static const char *const dw_id_names[] = {
    89         #include <debug/constants/dw_id.h>
     89#include <debug/constants/dw_id.inc>
    9090};
    9191
    9292static const char *const dw_cc_names[] = {
    93         #include <debug/constants/dw_cc.h>
     93#include <debug/constants/dw_cc.inc>
    9494};
    9595
    9696static const char *const dw_lns_names[] = {
    97         #include <debug/constants/dw_lns.h>
     97#include <debug/constants/dw_lns.inc>
    9898};
    9999
    100100static const char *const dw_lne_names[] = {
    101         #include <debug/constants/dw_lne.h>
     101#include <debug/constants/dw_lne.inc>
    102102};
    103103
    104104static const char *const dw_lnct_names[] = {
    105         #include <debug/constants/dw_lnct.h>
     105#include <debug/constants/dw_lnct.inc>
    106106};
    107107
  • kernel/generic/src/debug/stacktrace.c

    r2fbb42f r001957b6  
    125125static bool
    126126resolve_kernel_address(uintptr_t addr, int op_index,
    127                 const char **symbol, uintptr_t *symbol_addr,
    128                 const char **filename, const char **dirname,
    129                 int *line, int *column)
     127    const char **symbol, uintptr_t *symbol_addr,
     128    const char **filename, const char **dirname,
     129    int *line, int *column)
    130130{
    131131        *symbol_addr = 0;
  • kernel/generic/src/debug/util.c

    r2fbb42f r001957b6  
    3333#include <debug/names.h>
    3434
    35 /* These declarations cause global definitions for the functions to be emitted
     35/*
     36 * These declarations cause global definitions for the functions to be emitted
    3637 * in this compilation unit, so if the compiler decides not to inline some of
    3738 * them, only one external copy exists. See C99 inline rules.
     
    186187
    187188void print_block(const uint8_t **const data,
    188             const uint8_t *data_end, unsigned bytes)
     189    const uint8_t *data_end, unsigned bytes)
    189190{
    190191        while (bytes > 0 && *data < data_end) {
     
    196197
    197198void print_formed_data(unsigned form, const uint8_t **const data,
    198             const uint8_t *data_end, unsigned width)
     199    const uint8_t *data_end, unsigned width)
    199200{
    200201        size_t len;
     
    266267                uint64_t data1 = read_uint64(data, data_end);
    267268                uint64_t data2 = read_uint64(data, data_end);
    268                 DEBUGF("0x%016"PRIx64"%016"PRIx64, data2, data1);
     269                DEBUGF("0x%016" PRIx64 "%016" PRIx64, data2, data1);
    269270                break;
    270271
  • kernel/generic/src/debug/util.h

    r2fbb42f r001957b6  
    5454}
    5555
     56/* Casting to these structures allows us to read unaligned integers safely. */
     57struct u16 {
     58        uint16_t val;
     59} __attribute__((packed));
     60
     61struct u32 {
     62        uint32_t val;
     63} __attribute__((packed));
     64
     65struct u64 {
     66        uint64_t val;
     67} __attribute__((packed));
     68
    5669inline uint16_t read_uint16(const uint8_t **data, const uint8_t *data_end)
    5770{
    58         /* Casting to these structures allows us to read unaligned integers safely. */
    59         struct u16 {
    60                 uint16_t val;
    61         } __attribute__((packed));
    62 
    6371        if (*data + 2 > data_end) {
    6472                /* Safe exit path for malformed input. */
     
    92100inline uint32_t read_uint32(const uint8_t **data, const uint8_t *data_end)
    93101{
    94         struct u32 {
    95                 uint32_t val;
    96         } __attribute__((packed));
    97 
    98102        if (*data + 4 > data_end) {
    99103                /* Safe exit path for malformed input. */
     
    109113inline uint64_t read_uint64(const uint8_t **data, const uint8_t *data_end)
    110114{
    111         struct u64 {
    112                 uint64_t val;
    113         } __attribute__((packed));
    114 
    115115        if (*data + 8 > data_end) {
    116116                /* Safe exit path for malformed input. */
Note: See TracChangeset for help on using the changeset viewer.