Skip to content
Snippets Groups Projects
Select Git revision
  • d4295ca433175736474623156711d3e3f7b94138
  • master default protected
  • add-utime-unix_time-expansion
  • add-monotonic-time
  • add-digiclk
  • genofire/rockets-state
  • genofire/ble-follow-py
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • genofire/haule-ble-fs-deactive
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • koalo/wip/i2c-for-python
  • renze/safe_mode
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
34 results

modules.h

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    nlrthumb.S 6.09 KiB
    /*
     * This file is part of the MicroPython project, http://micropython.org/
     *
     * The MIT License (MIT)
     *
     * Copyright (c) 2013-2015 Damien P. George
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy
     * of this software and associated documentation files (the "Software"), to deal
     * in the Software without restriction, including without limitation the rights
     * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     * copies of the Software, and to permit persons to whom the Software is
     * furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice shall be included in
     * all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     * THE SOFTWARE.
     */
    
    #if (!defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP) && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
    
    // We only need the functions here if we are on arm/thumb, and we are not
    // using setjmp/longjmp.
    //
    // For reference, arm/thumb callee save regs are:
    //      r4-r11, r13=sp
    
    // the offset of nlr_top within mp_state_ctx_t
    #define NLR_TOP_OFFSET (2 * 4)
    
        .syntax unified
        /*.cpu cortex-m4*/
        /*.thumb*/
        .text
        .align  2
    
    /**************************************/
    // mp_uint_t nlr_push(r0=nlr_buf_t *nlr)
    
        .global nlr_push
    #if defined(__thumb2__)
        .thumb
        .thumb_func
    #endif
        .type   nlr_push, %function
    nlr_push:
        str     r4, [r0, #12]           @ store r4 into nlr_buf
        str     r5, [r0, #16]           @ store r5 into nlr_buf
        str     r6, [r0, #20]           @ store r6 into nlr_buf
        str     r7, [r0, #24]           @ store r7 into nlr_buf
    
    #if defined(__ARM_ARCH_6M__)
        mov     r1, r8
        str     r1, [r0, #28]           @ store r8 into nlr_buf
        mov     r1, r9
        str     r1, [r0, #32]           @ store r9 into nlr_buf
        mov     r1, r10
        str     r1, [r0, #36]           @ store r10 into nlr_buf
        mov     r1, r11
        str     r1, [r0, #40]           @ store r11 into nlr_buf
        mov     r1, r13
        str     r1, [r0, #44]           @ store r13=sp into nlr_buf
        mov     r1, lr