pkarashchenko commented on a change in pull request #5720: URL: https://github.com/apache/incubator-nuttx/pull/5720#discussion_r825362660
########## File path: arch/arm/src/common/arm_internal.h ########## @@ -182,6 +182,19 @@ #define INTSTACK_COLOR 0xdeadbeef #define HEAP_COLOR 'h' +#define getreg8(a) (*(volatile uint8_t *)(a)) +#define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) +#define getreg16(a) (*(volatile uint16_t *)(a)) +#define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) +#define getreg32(a) (*(volatile uint32_t *)(a)) +#define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) + +/* Non-atomic, but more effective modification of registers */ + +#define modreg8(v,m,a) putreg8((getreg8(a) & ~(m)) | ((v) & (m)), a) +#define modreg16(v,m,a) putreg16((getreg16(a) & ~(m)) | ((v) & (m)), a) +#define modreg32(v,m,a) putreg32((getreg32(a) & ~(m)) | ((v) & (m)), a) Review comment: ```suggestion #define modreg8(v,m,a) putreg8((getreg8(a) & ~(m)) | ((v) & (m)), (a)) #define modreg16(v,m,a) putreg16((getreg16(a) & ~(m)) | ((v) & (m)), (a)) #define modreg32(v,m,a) putreg32((getreg32(a) & ~(m)) | ((v) & (m)), (a)) ``` ########## File path: arch/arm/src/dm320/dm320_gio.h ########## @@ -27,7 +27,7 @@ #ifndef __ASSEMBLY__ # include <stdint.h> -# include "arm_arch.h" +# include "arm_internal.h" #endif Review comment: ```suggestion #endif #include "arm_internal.h" ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org