<commit_before>#pragma once

#define CRUNTIME_H
/** parts of the c startup that might be useful to a running program */

extern "C" [[gnu::naked,noreturn]] void generateHardReset();

/** these structs are created via LONG(...) directives in the ld file.
   That way only one symbol needs to be shared between the ld file and this file for each block.*/
struct RamBlock {
  unsigned int *address;
  unsigned int length; //number of unsigneds
  /** NB: this startup presumes 32 bit aligned, 32bit padded bss, but linker gives byte addresses and counts.
   *  Does anyone remember what BSS originally meant? Nowadays it is 'zeroed static variables' */
  void go(void)const{
    unsigned *target=address;
    unsigned count=length;
    while(count-- > 0) {
      *target++ = 0;
    }
  }
};

struct RamInitBlock {
  const unsigned int *rom;
  RamBlock ram;
  /** NB: this startup presumes 32 bit aligned, 32bit padded structures, but linker gives byte addresses and counts
 compared to common usage of memcpy this moves 4 bytes at a time, without the overhead of testing whether that can be done. */
  void go(void)const {
  //using local is slightly faster than member
    const unsigned int *source=rom;
    unsigned *target=ram.address;
    unsigned length=ram.length;
    while(length-- > 0) {
      *target++ = *source++;
    }
  }
};

/** every type of code driven initialization is invoked through a simple void fn(void)*/
typedef void (*InitRoutine)(void) ;
/** this implementation trusts the linker script to null terminate the table.
 * To insert something into the table you must put it into a section .ctors[.*]. lower number/alpha after the 'ctors' run earlier.
 * the 'initialization priority logic' uses such sections to control startup sequencing, and doesn't work without linker support.
 */
void run_table( const InitRoutine * table);

/** generate hard reset if the stack has overflowed */
void stackFault();<commit_msg>removed one more clock from ram init loops<commit_after>#pragma once

#define CRUNTIME_H
/** parts of the c startup that might be useful to a running program */

extern "C" [[gnu::naked,noreturn]] void generateHardReset();

/** these structs are created via LONG(...) directives in the ld file.
   That way only one symbol needs to be shared between the ld file and this file for each block.*/
struct RamBlock {
  unsigned int *address;
  unsigned int length; //number of unsigneds
  /** NB: this startup presumes 32 bit aligned, 32bit padded bss, but linker gives byte addresses and counts.
   *  Does anyone remember what BSS originally meant? Nowadays it is 'zeroed static variables' */
  void go(void)const{
    unsigned *target=address;
    for(unsigned count=length;count> 0;--count) {
      *target++ = 0;
    }
  }
};

struct RamInitBlock {
  const unsigned int *rom;
  RamBlock ram;
  /** NB: this startup presumes 32 bit aligned, 32bit padded structures, but linker gives byte addresses and counts
 compared to common usage of memcpy this moves 4 bytes at a time, without the overhead of testing whether that can be done. */
  void go(void)const {
  //using local is slightly faster than member
    const unsigned int *source=rom;
    unsigned *target=ram.address;
    for(unsigned length=ram.length;length> 0;--length) {
      *target++ = *source++;
    }
  }
};

/** every type of code driven initialization is invoked through a simple void fn(void)*/
typedef void (*InitRoutine)(void) ;
/** this implementation trusts the linker script to null terminate the table.
 * To insert something into the table you must put it into a section .ctors[.*]. lower number/alpha after the 'ctors' run earlier.
 * the 'initialization priority logic' uses such sections to control startup sequencing, and doesn't work without linker support.
 */
void run_table( const InitRoutine * table);

/** generate hard reset if the stack has overflowed */
void stackFault();
{'fraction_non_alphanumeric': 0.08829568788501027, 'fraction_numerical': 0.006160164271047228, 'mean_word_length': 3.7992610837438425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2578640', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1026, 'n_words': 508}