psp_addr.c

  name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-5572165936844014&dt=1194442938015&lmt=1194190197&format=336x280_as&output=html&correlator=1194442937843&url=file%3A%2F%2F%2FC%3A%2FDocuments%2520and%2520Settings%2Flhh1%2F%E6%A1%8C%E9%9D%A2%2FCLanguage.htm&color_bg=FFFFFF&color_text=000000&color_link=000000&color_url=FFFFFF&color_border=FFFFFF&ad_type=text&ga_vid=583001034.1194442938&ga_sid=1194442938&ga_hid=1942779085&flash=9&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="336" scrolling="no" height="280" allowtransparency="allowtransparency"> #include <stdio.h>
#include <dos.h>

void main(void)
 {
   printf("The Program Segment Prefix begins at %X/n", _psp);
 }

Build started: Project: STM32_Proj *** Using Compiler 'V6.19', folder: 'D:\Keil_v5\ARM\ARMCLANG\Bin' Build target 'STM32F103ZE' ../Libraries/CMSIS/core_cm3.c(445): error: non-ASM statement in naked function is not supported uint32_t result=0; ^ ../Libraries/CMSIS/core_cm3.c(442): note: attribute is here uint32_t __get_PSP(void) __attribute__( ( naked ) ); ^ ../Libraries/CMSIS/core_cm3.c(465): error: parameter references not allowed in naked functions "BX lr \n\t" : : "r" (topOfProcStack) ); ^ ../Libraries/CMSIS/core_cm3.c(461): note: attribute is here void __set_PSP(uint32_t topOfProcStack) __attribute__( ( naked ) ); ^ ../Libraries/CMSIS/core_cm3.c(479): error: non-ASM statement in naked function is not supported uint32_t result=0; ^ ../Libraries/CMSIS/core_cm3.c(476): note: attribute is here uint32_t __get_MSP(void) __attribute__( ( naked ) ); ^ ../Libraries/CMSIS/core_cm3.c(499): error: parameter references not allowed in naked functions "BX lr \n\t" : : "r" (topOfMainStack) ); ^ ../Libraries/CMSIS/core_cm3.c(495): note: attribute is here void __set_MSP(uint32_t topOfMainStack) __attribute__( ( naked ) ); ^ ../Libraries/CMSIS/core_cm3.c(509): warning: no previous prototype for function '__get_BASEPRI' [-Wmissing-prototypes] uint32_t __get_BASEPRI(void) ^ ../Libraries/CMSIS/core_cm3.c(509): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __get_BASEPRI(void) ^ static ../Libraries/CMSIS/core_cm3.c(524): warning: no previous prototype for function '__set_BASEPRI' [-Wmissing-prototypes] void __set_BASEPRI(uint32_t value) ^ ../Libraries/CMSIS/core_cm3.c(524): note: declare 'static' if the function is not intended to be used outside of this translation unit void __set_BASEPRI(uint32_t value) ^ static ../Libraries/CMSIS/core_cm3.c(536): warning: no previous prototype for function '__get_PRIMASK' [-Wmissing-prototypes] uint32_t __get_PRIMASK(void) ^ ../Libraries/CMSIS/core_cm3.c(536): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __get_PRIMASK(void) ^ static ../Libraries/CMSIS/core_cm3.c(551): warning: no previous prototype for function '__set_PRIMASK' [-Wmissing-prototypes] void __set_PRIMASK(uint32_t priMask) ^ ../Libraries/CMSIS/core_cm3.c(551): note: declare 'static' if the function is not intended to be used outside of this translation unit void __set_PRIMASK(uint32_t priMask) ^ static ../Libraries/CMSIS/core_cm3.c(563): warning: no previous prototype for function '__get_FAULTMASK' [-Wmissing-prototypes] uint32_t __get_FAULTMASK(void) ^ ../Libraries/CMSIS/core_cm3.c(563): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __get_FAULTMASK(void) ^ static ../Libraries/CMSIS/core_cm3.c(578): warning: no previous prototype for function '__set_FAULTMASK' [-Wmissing-prototypes] void __set_FAULTMASK(uint32_t faultMask) ^ ../Libraries/CMSIS/core_cm3.c(578): note: declare 'static' if the function is not intended to be used outside of this translation unit void __set_FAULTMASK(uint32_t faultMask) ^ static ../Libraries/CMSIS/core_cm3.c(590): warning: no previous prototype for function '__get_CONTROL' [-Wmissing-prototypes] uint32_t __get_CONTROL(void) ^ ../Libraries/CMSIS/core_cm3.c(590): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __get_CONTROL(void) ^ static ../Libraries/CMSIS/core_cm3.c(605): warning: no previous prototype for function '__set_CONTROL' [-Wmissing-prototypes] void __set_CONTROL(uint32_t control) ^ ../Libraries/CMSIS/core_cm3.c(605): note: declare 'static' if the function is not intended to be used outside of this translation unit void __set_CONTROL(uint32_t control) ^ static ../Libraries/CMSIS/core_cm3.c(619): warning: no previous prototype for function '__REV' [-Wmissing-prototypes] uint32_t __REV(uint32_t value) ^ ../Libraries/CMSIS/core_cm3.c(619): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __REV(uint32_t value) ^ static ../Libraries/CMSIS/core_cm3.c(635): warning: no previous prototype for function '__REV16' [-Wmissing-prototypes] uint32_t __REV16(uint16_t value) ^ ../Libraries/CMSIS/core_cm3.c(635): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __REV16(uint16_t value) ^ static ../Libraries/CMSIS/core_cm3.c(656): warning: implicit conversion changes signedness: 'uint32_t' (aka 'unsigned int') to 'int32_t' (aka 'int') [-Wsign-conversion] return(result); ~~~~~~ ^~~~~~ ../Libraries/CMSIS/core_cm3.c(651): warning: no previous prototype for function '__REVSH' [-Wmissing-prototypes] int32_t __REVSH(int16_t value) ^ ../Libraries/CMSIS/core_cm3.c(651): note: declare 'static' if the function is not intended to be used outside of this translation unit int32_t __REVSH(int16_t value) ^ static ../Libraries/CMSIS/core_cm3.c(667): warning: no previous prototype for function '__RBIT' [-Wmissing-prototypes] uint32_t __RBIT(uint32_t value) ^ ../Libraries/CMSIS/core_cm3.c(667): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __RBIT(uint32_t value) ^ static ../Libraries/CMSIS/core_cm3.c(683): warning: no previous prototype for function '__LDREXB' [-Wmissing-prototypes] uint8_t __LDREXB(uint8_t *addr) ^ ../Libraries/CMSIS/core_cm3.c(683): note: declare 'static' if the function is not intended to be used outside of this translation unit uint8_t __LDREXB(uint8_t *addr) ^ static ../Libraries/CMSIS/core_cm3.c(699): warning: no previous prototype for function '__LDREXH' [-Wmissing-prototypes] uint16_t __LDREXH(uint16_t *addr) ^ ../Libraries/CMSIS/core_cm3.c(699): note: declare 'static' if the function is not intended to be used outside of this translation unit uint16_t __LDREXH(uint16_t *addr) ^ static ../Libraries/CMSIS/core_cm3.c(715): warning: no previous prototype for function '__LDREXW' [-Wmissing-prototypes] uint32_t __LDREXW(uint32_t *addr) ^ ../Libraries/CMSIS/core_cm3.c(715): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __LDREXW(uint32_t *addr) ^ static ../Libraries/CMSIS/core_cm3.c(732): warning: no previous prototype for function '__STREXB' [-Wmissing-prototypes] uint32_t __STREXB(uint8_t value, uint8_t *addr) ^ ../Libraries/CMSIS/core_cm3.c(732): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __STREXB(uint8_t value, uint8_t *addr) ^ static ../Libraries/CMSIS/core_cm3.c(749): warning: no previous prototype for function '__STREXH' [-Wmissing-prototypes] uint32_t __STREXH(uint16_t value, uint16_t *addr) ^ ../Libraries/CMSIS/core_cm3.c(749): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __STREXH(uint16_t value, uint16_t *addr) ^ static ../Libraries/CMSIS/core_cm3.c(766): warning: no previous prototype for function '__STREXW' [-Wmissing-prototypes] uint32_t __STREXW(uint32_t value, uint32_t *addr) ^ ../Libraries/CMSIS/core_cm3.c(766): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __STREXW(uint32_t value, uint32_t *addr) ^ static 19 warnings and 4 errors generated. compiling core_cm3.c... ../Libraries/CMSIS/system_stm32f10x.c(65): warning: In file included from... ../Libraries/CMSIS/stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] * - To use or not the peripheral<92>s drivers in application code(i.e. ^ ../Libraries/CMSIS/stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] * code will be based on direct access to peripheral<92>s registers ^ ../Libraries/CMSIS/stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] * - Macros to access peripheral<92>s registers hardware ^ ../Libraries/CMSIS/system_stm32f10x.c(65): warning: In file included from... ../Libraries/CMSIS/stm32f10x.h(478): warning: In file included from... ../Libraries/CMSIS/core_cm3.h(1204): error: unknown type name 'inline' static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1204): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); } ^ void ../Libraries/CMSIS/core_cm3.h(1205): error: unknown type name 'inline' static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1205): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); } ^ void ../Libraries/CMSIS/core_cm3.h(1207): error: unknown type name 'inline' static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1207): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); } ^ void ../Libraries/CMSIS/core_cm3.h(1208): error: unknown type name 'inline' static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1208): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); } ^ void ../Libraries/CMSIS/core_cm3.h(1210): error: unknown type name 'inline' static __INLINE void __NOP() { __ASM volatile ("nop"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1210): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __NOP() { __ASM volatile ("nop"); } ^ void ../Libraries/CMSIS/core_cm3.h(1211): error: unknown type name 'inline' static __INLINE void __WFI() { __ASM volatile ("wfi"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1211): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __WFI() { __ASM volatile ("wfi"); } ^ void ../Libraries/CMSIS/core_cm3.h(1212): error: unknown type name 'inline' static __INLINE void __WFE() { __ASM volatile ("wfe"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1212): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __WFE() { __ASM volatile ("wfe"); } ^ void ../Libraries/CMSIS/core_cm3.h(1213): error: unknown type name 'inline' static __INLINE void __SEV() { __ASM volatile ("sev"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1213): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __SEV() { __ASM volatile ("sev"); } ^ void ../Libraries/CMSIS/core_cm3.h(1214): error: unknown type name 'inline' static __INLINE void __ISB() { __ASM volatile ("isb"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1214): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __ISB() { __ASM volatile ("isb"); } ^ void ../Libraries/CMSIS/core_cm3.h(1215): error: unknown type name 'inline' static __INLINE void __DSB() { __ASM volatile ("dsb"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1215): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __DSB() { __ASM volatile ("dsb"); } ^ void ../Libraries/CMSIS/core_cm3.h(1216): error: unknown type name 'inline' static __INLINE void __DMB() { __ASM volatile ("dmb"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1216): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __DMB() { __ASM volatile ("dmb"); } ^ void ../Libraries/CMSIS/core_cm3.h(1217): error: unknown type name 'inline' static __INLINE void __CLREX() { __ASM volatile ("clrex"); } ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1217): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static __INLINE void __CLREX() { __ASM volatile ("clrex"); } ^ void ../Libraries/CMSIS/core_cm3.h(1468): error: unknown type name 'inline' static __INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1489): error: unknown type name 'inline' static __INLINE uint32_t NVIC_GetPriorityGrouping(void) ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1489): error: expected ';' after top level declarator static __INLINE uint32_t NVIC_GetPriorityGrouping(void) ^ ; ../Libraries/CMSIS/core_cm3.h(1756): error: unknown type name 'inline' static __INLINE uint32_t ITM_SendChar (uint32_t ch) ^ ../Libraries/CMSIS/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ../Libraries/CMSIS/core_cm3.h(1756): error: expected ';' after top level declarator static __INLINE uint32_t ITM_SendChar (uint32_t ch) ^ ; ../Libraries/CMSIS/system_stm32f10x.c(162): warning: no previous extern declaration for non-static variable 'SystemCoreClock' [-Wmissing-variable-declarations] uint32_t SystemCoreClock = SYSCLK_FREQ_72MHz; /*!< System Clock Frequency (Core Clock) */ ^ ../Libraries/CMSIS/system_stm32f10x.c(162): note: declare 'static' if the variable is not intended to be used outside of this translation unit uint32_t SystemCoreClock = SYSCLK_FREQ_72MHz; /*!< System Clock Frequency (Core Clock) */ ^ ../Libraries/CMSIS/system_stm32f10x.c(167): warning: no previous extern declaration for non-static variable 'AHBPrescTable' [-Wmissing-variable-declarations] __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; ^ ../Libraries/CMSIS/system_stm32f10x.c(167): note: declare 'static' if the variable is not intended to be used outside of this translation unit __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; ^ 17 warnings and 17 errors generated. compiling system_stm32f10x.c... ../Libraries/FWlib/src/misc.c(24): error: 'misc.h' file not found #include "misc.h" ^~~~~~~~ 1 error generated. compiling misc.c... ../Libraries/FWlib/src/stm32f10x_adc.c(23): error: 'stm32f10x_adc.h' file not found #include "stm32f10x_adc.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_adc.c... ../Libraries/FWlib/src/stm32f10x_bkp.c(23): error: 'stm32f10x_bkp.h' file not found #include "stm32f10x_bkp.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_bkp.c... ../Libraries/FWlib/src/stm32f10x_can.c(23): error: 'stm32f10x_can.h' file not found #include "stm32f10x_can.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_can.c... ../Libraries/FWlib/src/stm32f10x_crc.c(23): error: 'stm32f10x_crc.h' file not found #include "stm32f10x_crc.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_crc.c... ../Libraries/FWlib/src/stm32f10x_cec.c(23): error: 'stm32f10x_cec.h' file not found #include "stm32f10x_cec.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_cec.c... ../Libraries/FWlib/src/stm32f10x_exti.c(23): error: 'stm32f10x_exti.h' file not found #include "stm32f10x_exti.h" ^~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_exti.c... ../Libraries/FWlib/src/stm32f10x_dma.c(23): error: 'stm32f10x_dma.h' file not found #include "stm32f10x_dma.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_dma.c... ../Libraries/FWlib/src/stm32f10x_dac.c(23): error: 'stm32f10x_dac.h' file not found #include "stm32f10x_dac.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_dac.c... ../Libraries/FWlib/src/stm32f10x_dbgmcu.c(23): error: 'stm32f10x_dbgmcu.h' file not found #include "stm32f10x_dbgmcu.h" ^~~~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_dbgmcu.c... ../Libraries/FWlib/src/stm32f10x_flash.c(23): error: 'stm32f10x_flash.h' file not found #include "stm32f10x_flash.h" ^~~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_flash.c... ../Libraries/FWlib/src/stm32f10x_fsmc.c(23): error: 'stm32f10x_fsmc.h' file not found #include "stm32f10x_fsmc.h" ^~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_fsmc.c... ../Libraries/FWlib/src/stm32f10x_gpio.c(23): error: 'stm32f10x_gpio.h' file not found #include "stm32f10x_gpio.h" ^~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_gpio.c... ../Libraries/FWlib/src/stm32f10x_i2c.c(23): error: 'stm32f10x_i2c.h' file not found #include "stm32f10x_i2c.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_i2c.c... ../Libraries/FWlib/src/stm32f10x_iwdg.c(23): error: 'stm32f10x_iwdg.h' file not found #include "stm32f10x_iwdg.h" ^~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_iwdg.c... ../Libraries/FWlib/src/stm32f10x_pwr.c(23): error: 'stm32f10x_pwr.h' file not found #include "stm32f10x_pwr.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_pwr.c... ../Libraries/FWlib/src/stm32f10x_rcc.c(23): error: 'stm32f10x_rcc.h' file not found #include "stm32f10x_rcc.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_rcc.c... ../Libraries/FWlib/src/stm32f10x_rtc.c(23): error: 'stm32f10x_rtc.h' file not found #include "stm32f10x_rtc.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_rtc.c... ../Libraries/FWlib/src/stm32f10x_sdio.c(23): error: 'stm32f10x_sdio.h' file not found #include "stm32f10x_sdio.h" ^~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_sdio.c... ../Libraries/FWlib/src/stm32f10x_spi.c(23): error: 'stm32f10x_spi.h' file not found #include "stm32f10x_spi.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_spi.c... ../Libraries/FWlib/src/stm32f10x_tim.c(23): error: 'stm32f10x_tim.h' file not found #include "stm32f10x_tim.h" ^~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_tim.c... ../Libraries/FWlib/src/stm32f10x_usart.c(23): error: 'stm32f10x_usart.h' file not found #include "stm32f10x_usart.h" ^~~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_usart.c... ../Libraries/FWlib/src/stm32f10x_wwdg.c(23): error: 'stm32f10x_wwdg.h' file not found #include "stm32f10x_wwdg.h" ^~~~~~~~~~~~~~~~~~ 1 error generated. compiling stm32f10x_wwdg.c... ../Source/Main/main.c(1): warning: In file included from... D:/Keil_v5/ARM/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] * - To use or not the peripheral<92>s drivers in application code(i.e. ^ D:/Keil_v5/ARM/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] * code will be based on direct access to peripheral<92>s registers ^ D:/Keil_v5/ARM/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] * - Macros to access peripheral<92>s registers hardware ^ D:/Keil_v5/ARM/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(486): error: 'core_cm3.h' file not found #include "core_cm3.h" ^~~~~~~~~~~~ 3 warnings and 1 error generated. compiling main.c... ../Source/Main/stm32f10x_it.c(25): warning: In file included from... ../Source/Main/stm32f10x_it.h(31): warning: In file included from... D:/Keil_v5/ARM/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] * - To use or not the peripheral<92>s drivers in application code(i.e. ^ D:/Keil_v5/ARM/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] * code will be based on direct access to peripheral<92>s registers ^ D:/Keil_v5/ARM/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] * - Macros to access peripheral<92>s registers hardware ^ D:/Keil_v5/ARM/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(486): error: 'core_cm3.h' file not found #include "core_cm3.h" ^~~~~~~~~~~~
09-12
Build started: Project: 11 *** Using Compiler 'V6.18', folder: 'D:\kell\core\ARM\ARMCLANG\Bin' Build target 'Target 1' start/core_cm3.c(445): error: non-ASM statement in naked function is not supported uint32_t result=0; ^ start/core_cm3.c(442): note: attribute is here uint32_t __get_PSP(void) __attribute__( ( naked ) ); ^ start/core_cm3.c(465): error: parameter references not allowed in naked functions "BX lr \n\t" : : "r" (topOfProcStack) ); ^ start/core_cm3.c(461): note: attribute is here void __set_PSP(uint32_t topOfProcStack) __attribute__( ( naked ) ); ^ start/core_cm3.c(479): error: non-ASM statement in naked function is not supported uint32_t result=0; ^ start/core_cm3.c(476): note: attribute is here uint32_t __get_MSP(void) __attribute__( ( naked ) ); ^ start/core_cm3.c(499): error: parameter references not allowed in naked functions "BX lr \n\t" : : "r" (topOfMainStack) ); ^ start/core_cm3.c(495): note: attribute is here void __set_MSP(uint32_t topOfMainStack) __attribute__( ( naked ) ); ^ start/core_cm3.c(509): warning: no previous prototype for function '__get_BASEPRI' [-Wmissing-prototypes] uint32_t __get_BASEPRI(void) ^ start/core_cm3.c(509): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __get_BASEPRI(void) ^ static start/core_cm3.c(524): warning: no previous prototype for function '__set_BASEPRI' [-Wmissing-prototypes] void __set_BASEPRI(uint32_t value) ^ start/core_cm3.c(524): note: declare 'static' if the function is not intended to be used outside of this translation unit void __set_BASEPRI(uint32_t value) ^ static start/core_cm3.c(536): warning: no previous prototype for function '__get_PRIMASK' [-Wmissing-prototypes] uint32_t __get_PRIMASK(void) ^ start/core_cm3.c(536): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __get_PRIMASK(void) ^ static start/core_cm3.c(551): warning: no previous prototype for function '__set_PRIMASK' [-Wmissing-prototypes] void __set_PRIMASK(uint32_t priMask) ^ start/core_cm3.c(551): note: declare 'static' if the function is not intended to be used outside of this translation unit void __set_PRIMASK(uint32_t priMask) ^ static start/core_cm3.c(563): warning: no previous prototype for function '__get_FAULTMASK' [-Wmissing-prototypes] uint32_t __get_FAULTMASK(void) ^ start/core_cm3.c(563): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __get_FAULTMASK(void) ^ static start/core_cm3.c(578): warning: no previous prototype for function '__set_FAULTMASK' [-Wmissing-prototypes] void __set_FAULTMASK(uint32_t faultMask) ^ start/core_cm3.c(578): note: declare 'static' if the function is not intended to be used outside of this translation unit void __set_FAULTMASK(uint32_t faultMask) ^ static start/core_cm3.c(590): warning: no previous prototype for function '__get_CONTROL' [-Wmissing-prototypes] uint32_t __get_CONTROL(void) ^ start/core_cm3.c(590): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __get_CONTROL(void) ^ static start/core_cm3.c(605): warning: no previous prototype for function '__set_CONTROL' [-Wmissing-prototypes] void __set_CONTROL(uint32_t control) ^ start/core_cm3.c(605): note: declare 'static' if the function is not intended to be used outside of this translation unit void __set_CONTROL(uint32_t control) ^ static start/core_cm3.c(619): warning: no previous prototype for function '__REV' [-Wmissing-prototypes] uint32_t __REV(uint32_t value) ^ start/core_cm3.c(619): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __REV(uint32_t value) ^ static start/core_cm3.c(635): warning: no previous prototype for function '__REV16' [-Wmissing-prototypes] uint32_t __REV16(uint16_t value) ^ start/core_cm3.c(635): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __REV16(uint16_t value) ^ static start/core_cm3.c(656): warning: implicit conversion changes signedness: 'uint32_t' (aka 'unsigned int') to 'int32_t' (aka 'int') [-Wsign-conversion] return(result); ~~~~~~ ^~~~~~ start/core_cm3.c(651): warning: no previous prototype for function '__REVSH' [-Wmissing-prototypes] int32_t __REVSH(int16_t value) ^ start/core_cm3.c(651): note: declare 'static' if the function is not intended to be used outside of this translation unit int32_t __REVSH(int16_t value) ^ static start/core_cm3.c(667): warning: no previous prototype for function '__RBIT' [-Wmissing-prototypes] uint32_t __RBIT(uint32_t value) ^ start/core_cm3.c(667): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __RBIT(uint32_t value) ^ static start/core_cm3.c(683): warning: no previous prototype for function '__LDREXB' [-Wmissing-prototypes] uint8_t __LDREXB(uint8_t *addr) ^ start/core_cm3.c(683): note: declare 'static' if the function is not intended to be used outside of this translation unit uint8_t __LDREXB(uint8_t *addr) ^ static start/core_cm3.c(699): warning: no previous prototype for function '__LDREXH' [-Wmissing-prototypes] uint16_t __LDREXH(uint16_t *addr) ^ start/core_cm3.c(699): note: declare 'static' if the function is not intended to be used outside of this translation unit uint16_t __LDREXH(uint16_t *addr) ^ static start/core_cm3.c(715): warning: no previous prototype for function '__LDREXW' [-Wmissing-prototypes] uint32_t __LDREXW(uint32_t *addr) ^ start/core_cm3.c(715): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __LDREXW(uint32_t *addr) ^ static start/core_cm3.c(732): warning: no previous prototype for function '__STREXB' [-Wmissing-prototypes] uint32_t __STREXB(uint8_t value, uint8_t *addr) ^ start/core_cm3.c(732): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __STREXB(uint8_t value, uint8_t *addr) ^ static start/core_cm3.c(749): warning: no previous prototype for function '__STREXH' [-Wmissing-prototypes] uint32_t __STREXH(uint16_t value, uint16_t *addr) ^ start/core_cm3.c(749): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __STREXH(uint16_t value, uint16_t *addr) ^ static start/core_cm3.c(766): warning: no previous prototype for function '__STREXW' [-Wmissing-prototypes] uint32_t __STREXW(uint32_t value, uint32_t *addr) ^ start/core_cm3.c(766): note: declare 'static' if the function is not intended to be used outside of this translation unit uint32_t __STREXW(uint32_t value, uint32_t *addr) ^ static 19 warnings and 4 errors generated. compiling core_cm3.c... start/system_stm32f10x.c(65): warning: In file included from... ./start/stm32f10x.h(478): warning: In file included from... ./start/core_cm3.h(1204): error: unknown type name 'inline' static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1205): error: unknown type name 'inline' static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1207): error: unknown type name 'inline' static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1208): error: unknown type name 'inline' static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1210): error: unknown type name 'inline' static __INLINE void __NOP() { __ASM volatile ("nop"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1211): error: unknown type name 'inline' static __INLINE void __WFI() { __ASM volatile ("wfi"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1212): error: unknown type name 'inline' static __INLINE void __WFE() { __ASM volatile ("wfe"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1213): error: unknown type name 'inline' static __INLINE void __SEV() { __ASM volatile ("sev"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1214): error: unknown type name 'inline' static __INLINE void __ISB() { __ASM volatile ("isb"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1215): error: unknown type name 'inline' static __INLINE void __DSB() { __ASM volatile ("dsb"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1216): error: unknown type name 'inline' static __INLINE void __DMB() { __ASM volatile ("dmb"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1217): error: unknown type name 'inline' static __INLINE void __CLREX() { __ASM volatile ("clrex"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1468): error: unknown type name 'inline' static __INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1489): error: unknown type name 'inline' static __INLINE uint32_t NVIC_GetPriorityGrouping(void) ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1489): error: expected ';' after top level declarator static __INLINE uint32_t NVIC_GetPriorityGrouping(void) ^ ; ./start/core_cm3.h(1756): error: unknown type name 'inline' static __INLINE uint32_t ITM_SendChar (uint32_t ch) ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1756): error: expected ';' after top level declarator static __INLINE uint32_t ITM_SendChar (uint32_t ch) ^ ; start/system_stm32f10x.c(162): warning: no previous extern declaration for non-static variable 'SystemCoreClock' [-Wmissing-variable-declarations] uint32_t SystemCoreClock = SYSCLK_FREQ_72MHz; /*!< System Clock Frequency (Core Clock) */ ^ start/system_stm32f10x.c(162): note: declare 'static' if the variable is not intended to be used outside of this translation unit uint32_t SystemCoreClock = SYSCLK_FREQ_72MHz; /*!< System Clock Frequency (Core Clock) */ ^ start/system_stm32f10x.c(167): warning: no previous extern declaration for non-static variable 'AHBPrescTable' [-Wmissing-variable-declarations] __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; ^ start/system_stm32f10x.c(167): note: declare 'static' if the variable is not intended to be used outside of this translation unit __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; ^ 2 warnings and 17 errors generated. compiling system_stm32f10x.c... user/main.c(1): warning: In file included from... ./start\stm32f10x.h(478): warning: In file included from... ./start/core_cm3.h(1204): error: unknown type name 'inline' static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1205): error: unknown type name 'inline' static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1207): error: unknown type name 'inline' static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1208): error: unknown type name 'inline' static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1210): error: unknown type name 'inline' static __INLINE void __NOP() { __ASM volatile ("nop"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1211): error: unknown type name 'inline' static __INLINE void __WFI() { __ASM volatile ("wfi"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1212): error: unknown type name 'inline' static __INLINE void __WFE() { __ASM volatile ("wfe"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1213): error: unknown type name 'inline' static __INLINE void __SEV() { __ASM volatile ("sev"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1214): error: unknown type name 'inline' static __INLINE void __ISB() { __ASM volatile ("isb"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1215): error: unknown type name 'inline' static __INLINE void __DSB() { __ASM volatile ("dsb"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1216): error: unknown type name 'inline' static __INLINE void __DMB() { __ASM volatile ("dmb"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1217): error: unknown type name 'inline' static __INLINE void __CLREX() { __ASM volatile ("clrex"); } ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1468): error: unknown type name 'inline' static __INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1489): error: unknown type name 'inline' static __INLINE uint32_t NVIC_GetPriorityGrouping(void) ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1489): error: expected ';' after top level declarator static __INLINE uint32_t NVIC_GetPriorityGrouping(void) ^ ; ./start/core_cm3.h(1756): error: unknown type name 'inline' static __INLINE uint32_t ITM_SendChar (uint32_t ch) ^ ./start/core_cm3.h(751): note: expanded from macro '__INLINE' #define __INLINE inline /*!< inline keyword for GNU Compiler */ ^ ./start/core_cm3.h(1756): error: expected ';' after top level declarator static __INLINE uint32_t ITM_SendChar (uint32_t ch) ^ ; 17 errors generated. compiling main.c... 阅读该错误报告并给出修改建议
最新发布
09-25
struct task_struct_offset { int16_t pid_offset; int16_t tgid_offset; int16_t thread_pid_offset; int16_t ptracer_cred_offset; int16_t real_cred_offset; int16_t cred_offset; int16_t comm_offset; int16_t fs_offset; int16_t files_offset; int16_t loginuid_offset; int16_t sessionid_offset; int16_t seccomp_offset; int16_t security_offset; int16_t stack_offset; int16_t tasks_offset; int16_t mm_offset; int16_t active_mm_offset; }; int resolve_current() { uint64_t sp_el0, sp; asm volatile("mrs %0, sp_el0" : "=r"(sp_el0)); asm volatile("mov %0, sp" : "=r"(sp)); sp_el0_is_current = 0; sp_el0_is_thread_info = 0; init_task = (struct task_struct *)kallsyms_lookup_name("init_task"); uint64_t init_thread_union_addr = kallsyms_lookup_name("init_thread_union"); if (is_kimg_range(sp_el0)) { if (sp_el0 == init_thread_union_addr) { sp_el0_is_thread_info = 1; } else if ((uint64_t)init_task == sp_el0 || (sp_el0 & (page_size - 1)) || (task_struct_offset.comm_offset = find_swapper_comm_offset(sp_el0, TASK_STRUCT_MAX_SIZE)) > 0) { sp_el0_is_current = 1; init_task = (struct task_struct *)sp_el0; } else { sp_el0_is_thread_info = 1; } } int thread_shift_cand[] = { 14, 15, 16 }; for (int i = 0; i < sizeof(thread_shift_cand) / sizeof(thread_shift_cand[0]); i++) { int tsz = 1 << thread_shift_cand[i]; uint64_t sp_low = sp & ~(tsz - 1); uint64_t psp = sp_low; for (; psp < sp_low + THREAD_INFO_MAX_SIZE; psp += 8) { if (*(uint64_t *)psp == STACK_END_MAGIC) { if (psp == sp_low) { thread_size = tsz; stack_end_offset = 0; thread_info_in_task = 1; } else { thread_size = tsz; stack_end_offset = psp - sp_low; thread_info_in_task = 0; } break; } } } if (!thread_info_in_task) { uint64_t thread_info_addr = (uint64_t)current_thread_info_sp(); if (init_task) { for (uint64_t ptr = thread_info_addr; ptr < thread_info_addr + stack_end_offset; ptr += sizeof(uint64_t)) { uint64_t pv = *(uint64_t *)ptr; if (pv == (uint64_t)init_task) { task_in_thread_info_offset = ptr - thread_info_addr; break; } } } else { for (uint64_t ptr = thread_info_addr; ptr < thread_info_addr + stack_end_offset; ptr += sizeof(uint64_t)) { uint64_t pv = *(uint64_t *)ptr; task_struct_offset.comm_offset = find_swapper_comm_offset(pv, TASK_STRUCT_MAX_SIZE); if (task_struct_offset.comm_offset > 0) { init_task = (struct task_struct *)pv; task_in_thread_info_offset = ptr - thread_info_addr; } } } } if (task_struct_offset.comm_offset <= 0) { task_struct_offset.comm_offset = find_swapper_comm_offset((uint64_t)init_task, TASK_STRUCT_MAX_SIZE); } uint64_t stack_base = (sp & ~(thread_size - 1)); for (uintptr_t i = (uintptr_t)init_task; i < (uintptr_t)init_task + TASK_STRUCT_MAX_SIZE; i += sizeof(uintptr_t)) { uintptr_t val = *(uintptr_t *)i; if (stack_base == val) { stack_in_task_offset = i - (uintptr_t)init_task; task_struct_offset.stack_offset = stack_in_task_offset; break; } } return 0; }请问tasks_offset应该按照这样的代码方法获取呢?
03-23
static int csv_send_encrypt_data(CsvGuestState *s, QEMUFile *f, uint8_t *ptr, uint32_t size, uint64_t *bytes_sent) { int ret, fw_error; guchar *trans; uint32_t guest_addr_entry_num; uint32_t i; struct kvm_csv3_send_encrypt_data update = { }; /* * If this is first call then query the packet header bytes and allocate * the packet buffer. */ if (!s->send_packet_hdr) { s->send_packet_hdr_len = csv_send_get_packet_len(&fw_error); if (s->send_packet_hdr_len < 1) { error_report("%s: SEND_UPDATE fw_error=%d '%s'", __func__, fw_error, fw_error_to_str(fw_error)); return 1; } s->send_packet_hdr = g_new(gchar, s->send_packet_hdr_len); } if (!s->guest_addr_len || !s->guest_addr_data) { error_report("%s: invalid host address or size", __func__); return 1; } else { guest_addr_entry_num = s->guest_addr_len / sizeof(struct guest_addr_entry); } /* allocate transport buffer */ trans = g_new(guchar, guest_addr_entry_num * TARGET_PAGE_SIZE); update.hdr_uaddr = (uintptr_t)s->send_packet_hdr; update.hdr_len = s->send_packet_hdr_len; update.guest_addr_data = (uintptr_t)s->guest_addr_data; update.guest_addr_len = s->guest_addr_len; update.trans_uaddr = (uintptr_t)trans; update.trans_len = guest_addr_entry_num * TARGET_PAGE_SIZE; trace_kvm_csv3_send_encrypt_data(trans, update.trans_len); ret = csv3_ioctl(KVM_CSV3_SEND_ENCRYPT_DATA, &update, &fw_error); if (ret) { error_report("%s: SEND_ENCRYPT_DATA ret=%d fw_error=%d '%s'", __func__, ret, fw_error, fw_error_to_str(fw_error)); goto err; } for (i = 0; i < guest_addr_entry_num; i++) { if (s->guest_addr_data[i].share) memcpy(trans + i * TARGET_PAGE_SIZE, (guchar *)s->guest_hva_data[i].hva, TARGET_PAGE_SIZE); } qemu_put_be32(f, update.hdr_len); qemu_put_buffer(f, (uint8_t *)update.hdr_uaddr, update.hdr_len); *bytes_sent = 4 + update.hdr_len; qemu_put_be32(f, update.guest_addr_len); qemu_put_buffer(f, (uint8_t *)update.guest_addr_data, update.guest_addr_len); *bytes_sent = 4 + update.guest_addr_len; qemu_put_be32(f, update.trans_len); qemu_put_buffer(f, (uint8_t *)update.trans_uaddr, update.trans_len); *bytes_sent += (4 + update.trans_len); err: s->guest_addr_len = 0; g_free(trans); return ret; }
03-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值