16#ifndef _PICO_PLATFORM_H
17#define _PICO_PLATFORM_H
20#error pico/platform.h should not be included directly; include pico.h instead
25#ifndef PICO_USE_XIP_CACHE_AS_RAM
26#define PICO_USE_XIP_CACHE_AS_RAM 0
30#include "pico/platform/sections.h"
31#include "pico/platform/panic.h"
33#include "hardware/regs/addressmap.h"
34#include "hardware/regs/sio.h"
36#include "hardware/regs/rvcsr.h"
45#ifndef PICO_RP2350_A2_SUPPORTED
46#define PICO_RP2350_A2_SUPPORTED 1
50#ifndef PICO_STACK_SIZE
51#define PICO_STACK_SIZE _u(0x800)
56#define PICO_HEAP_SIZE _u(0x800)
60#ifndef PICO_NO_RAM_VECTOR_TABLE
61#define PICO_NO_RAM_VECTOR_TABLE 0
65#ifndef PICO_USE_STACK_GUARDS
66#define PICO_USE_STACK_GUARDS 0
70#ifndef PICO_CLKDIV_ROUND_NEAREST
71#define PICO_CLKDIV_ROUND_NEAREST 1
94 pico_default_asm_volatile (
108 :
"+r" (minimum_cycles) : :
"cc",
"memory"
119 pico_default_asm_volatile (
"bkpt #0" : : :
"memory");
129 return (*(uint32_t *) (SIO_BASE + SIO_CPUID_OFFSET));
148 pico_default_asm_volatile (
150 :
"=r" (meicontext) :
"i" (RVCSR_MEICONTEXT_OFFSET)
152 if (meicontext & RVCSR_MEICONTEXT_NOIRQ_BITS) {
155 return VTABLE_FIRST_IRQ + (
156 (meicontext & RVCSR_MEICONTEXT_IRQ_BITS) >> RVCSR_MEICONTEXT_IRQ_LSB
161 pico_default_asm_volatile (
181 pico_default_asm_volatile (
186 return !(tt & (1u << 22));
215 GCC_Pragma(
"GCC diagnostic push")
216 GCC_Pragma(
"GCC diagnostic ignored \"-Warray-bounds\"")
217 return *(uint8_t*)0x13;
218 GCC_Pragma(
"GCC diagnostic pop")
233 __asm (
"mul %0, %0, %1" :
"+r" (a) :
"r" (b) : );
235 pico_default_asm (
"muls %0, %1" :
"+l" (a) :
"l" (b) :
"cc");
253#define __fast_mul(a, b) (__builtin_constant_p(b) && !__builtin_constant_p(a) && __builtin_popcount(b) >= 2 ? __mul_instruction(a,b) : (a)*(b))
Macros and definitions common to all rp2 platforms but not specific to any library.
Macros and definitions (and functions when included by non assembly code) to adapt for different comp...