Skip to content

Commit

Permalink
cpu/msp430: implement get_caller_pc
Browse files Browse the repository at this point in the history
This "implements" the `get_caller_pc()` function by simply wiring up
compiler intrinsics.
  • Loading branch information
maribu committed Apr 19, 2024
1 parent ad9d501 commit f01fb53
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cpu/msp430/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
#ifndef CPU_H
#define CPU_H

#include <stdio.h>
#include <stdint.h>

#include <msp430.h>
#include "board.h"

#include "sched.h"
#include "thread.h"
#include "cpu_conf.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -118,12 +116,11 @@ static inline void __attribute__((always_inline)) __exit_isr(void)

/**
* @brief Returns the last instruction's address
*
* @todo: Not supported
*/
__attribute__((always_inline))
static inline uintptr_t cpu_get_caller_pc(void)
{
return 0;
return (uintptr_t)__builtin_return_address(0);
}

#ifdef __cplusplus
Expand Down

0 comments on commit f01fb53

Please sign in to comment.