1 .cpu arm7tdmi 2 .arch armv4t 3 .fpu softvfp 4 .eabi_attribute 20, 1 5 .eabi_attribute 21, 1 6 .eabi_attribute 23, 3 7 .eabi_attribute 24, 1 8 .eabi_attribute 25, 1 9 .eabi_attribute 26, 1 10 .eabi_attribute 30, 4 11 .eabi_attribute 34, 0 12 .eabi_attribute 18, 4 13 .file "main.c" 14 .text 15 .Ltext0: 16 .cfi_sections .debug_frame 17 .file 1 "apps/loader/main.c" 18 .section .text.msgb_pull_u8,"ax",%progbits 19 .align 2 20 .syntax unified 21 .arm 23 msgb_pull_u8: 24 .LVL0: 25 .LFB33: 26 .file 2 "../../shared/libosmocore/include/osmocom/core/msgb.h" 1:../../shared/libosmocore/include/osmocom/core/msgb.h **** #ifndef _MSGB_H 2:../../shared/libosmocore/include/osmocom/core/msgb.h **** #define _MSGB_H 3:../../shared/libosmocore/include/osmocom/core/msgb.h **** 4:../../shared/libosmocore/include/osmocom/core/msgb.h **** /* (C) 2008 by Harald Welte 5:../../shared/libosmocore/include/osmocom/core/msgb.h **** * All Rights Reserved 6:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 7:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This program is free software; you can redistribute it and/or modify 8:../../shared/libosmocore/include/osmocom/core/msgb.h **** * it under the terms of the GNU General Public License as published by 9:../../shared/libosmocore/include/osmocom/core/msgb.h **** * the Free Software Foundation; either version 2 of the License, or 10:../../shared/libosmocore/include/osmocom/core/msgb.h **** * (at your option) any later version. 11:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 12:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This program is distributed in the hope that it will be useful, 13:../../shared/libosmocore/include/osmocom/core/msgb.h **** * but WITHOUT ANY WARRANTY; without even the implied warranty of 14:../../shared/libosmocore/include/osmocom/core/msgb.h **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15:../../shared/libosmocore/include/osmocom/core/msgb.h **** * GNU General Public License for more details. 16:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 17:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 18:../../shared/libosmocore/include/osmocom/core/msgb.h **** 19:../../shared/libosmocore/include/osmocom/core/msgb.h **** #include 20:../../shared/libosmocore/include/osmocom/core/msgb.h **** #include 21:../../shared/libosmocore/include/osmocom/core/msgb.h **** #include 22:../../shared/libosmocore/include/osmocom/core/msgb.h **** 23:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \defgroup msgb Message buffers 24:../../shared/libosmocore/include/osmocom/core/msgb.h **** * @{ 25:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 26:../../shared/libosmocore/include/osmocom/core/msgb.h **** 27:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \file msgb.h 28:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \brief Osmocom message buffers 29:../../shared/libosmocore/include/osmocom/core/msgb.h **** * The Osmocom message buffers are modelled after the 'struct skb' 30:../../shared/libosmocore/include/osmocom/core/msgb.h **** * inside the Linux kernel network stack. As they exist in userspace, 31:../../shared/libosmocore/include/osmocom/core/msgb.h **** * they are much simplified. However, terminology such as headroom, 32:../../shared/libosmocore/include/osmocom/core/msgb.h **** * tailroom, push/pull/put etc. remains the same. 33:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 34:../../shared/libosmocore/include/osmocom/core/msgb.h **** 35:../../shared/libosmocore/include/osmocom/core/msgb.h **** #define MSGB_DEBUG 36:../../shared/libosmocore/include/osmocom/core/msgb.h **** 37:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief Osmocom message buffer */ 38:../../shared/libosmocore/include/osmocom/core/msgb.h **** struct msgb { 39:../../shared/libosmocore/include/osmocom/core/msgb.h **** struct llist_head list; /*!< \brief linked list header */ 40:../../shared/libosmocore/include/osmocom/core/msgb.h **** 41:../../shared/libosmocore/include/osmocom/core/msgb.h **** 42:../../shared/libosmocore/include/osmocom/core/msgb.h **** /* Part of which TRX logical channel we were received / transmitted */ 43:../../shared/libosmocore/include/osmocom/core/msgb.h **** /* FIXME: move them into the control buffer */ 44:../../shared/libosmocore/include/osmocom/core/msgb.h **** union { 45:../../shared/libosmocore/include/osmocom/core/msgb.h **** void *dst; /*!< \brief reference of origin/destination */ 46:../../shared/libosmocore/include/osmocom/core/msgb.h **** struct gsm_bts_trx *trx; 47:../../shared/libosmocore/include/osmocom/core/msgb.h **** }; 48:../../shared/libosmocore/include/osmocom/core/msgb.h **** struct gsm_lchan *lchan; /*!< \brief logical channel */ 49:../../shared/libosmocore/include/osmocom/core/msgb.h **** 50:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *l1h; /*!< \brief pointer to Layer1 header (if any) */ 51:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *l2h; /*!< \brief pointer to A-bis layer 2 header: OML, RSL(RLL), NS */ 52:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *l3h; /*!< \brief pointer to Layer 3 header. For OML: FOM; RSL: 04.08; GPRS: BSSGP * 53:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *l4h; /*!< \brief pointer to layer 4 header */ 54:../../shared/libosmocore/include/osmocom/core/msgb.h **** 55:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned long cb[5]; /*!< \brief control buffer */ 56:../../shared/libosmocore/include/osmocom/core/msgb.h **** 57:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint16_t data_len; /*!< \brief length of underlying data array */ 58:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint16_t len; /*!< \brief length of bytes used in msgb */ 59:../../shared/libosmocore/include/osmocom/core/msgb.h **** 60:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *head; /*!< \brief start of underlying memory buffer */ 61:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *tail; /*!< \brief end of message in buffer */ 62:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *data; /*!< \brief start of message in buffer */ 63:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char _data[0]; /*!< \brief optional immediate data array */ 64:../../shared/libosmocore/include/osmocom/core/msgb.h **** }; 65:../../shared/libosmocore/include/osmocom/core/msgb.h **** 66:../../shared/libosmocore/include/osmocom/core/msgb.h **** extern struct msgb *msgb_alloc(uint16_t size, const char *name); 67:../../shared/libosmocore/include/osmocom/core/msgb.h **** extern void msgb_free(struct msgb *m); 68:../../shared/libosmocore/include/osmocom/core/msgb.h **** extern void msgb_enqueue(struct llist_head *queue, struct msgb *msg); 69:../../shared/libosmocore/include/osmocom/core/msgb.h **** extern struct msgb *msgb_dequeue(struct llist_head *queue); 70:../../shared/libosmocore/include/osmocom/core/msgb.h **** extern void msgb_reset(struct msgb *m); 71:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint16_t msgb_length(const struct msgb *msg); 72:../../shared/libosmocore/include/osmocom/core/msgb.h **** 73:../../shared/libosmocore/include/osmocom/core/msgb.h **** #ifdef MSGB_DEBUG 74:../../shared/libosmocore/include/osmocom/core/msgb.h **** #include 75:../../shared/libosmocore/include/osmocom/core/msgb.h **** #define MSGB_ABORT(msg, fmt, args ...) do { \ 76:../../shared/libosmocore/include/osmocom/core/msgb.h **** osmo_panic("msgb(%p): " fmt, msg, ## args); \ 77:../../shared/libosmocore/include/osmocom/core/msgb.h **** } while(0) 78:../../shared/libosmocore/include/osmocom/core/msgb.h **** #else 79:../../shared/libosmocore/include/osmocom/core/msgb.h **** #define MSGB_ABORT(msg, fmt, args ...) 80:../../shared/libosmocore/include/osmocom/core/msgb.h **** #endif 81:../../shared/libosmocore/include/osmocom/core/msgb.h **** 82:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief obtain L1 header of msgb */ 83:../../shared/libosmocore/include/osmocom/core/msgb.h **** #define msgb_l1(m) ((void *)(m->l1h)) 84:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief obtain L2 header of msgb */ 85:../../shared/libosmocore/include/osmocom/core/msgb.h **** #define msgb_l2(m) ((void *)(m->l2h)) 86:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief obtain L3 header of msgb */ 87:../../shared/libosmocore/include/osmocom/core/msgb.h **** #define msgb_l3(m) ((void *)(m->l3h)) 88:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief obtain SMS header of msgb */ 89:../../shared/libosmocore/include/osmocom/core/msgb.h **** #define msgb_sms(m) ((void *)(m->l4h)) 90:../../shared/libosmocore/include/osmocom/core/msgb.h **** 91:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief determine length of L1 message 92:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 93:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns size of L1 message in bytes 94:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 95:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function computes the number of bytes between the tail of the 96:../../shared/libosmocore/include/osmocom/core/msgb.h **** * message and the layer 1 header. 97:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 98:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline unsigned int msgb_l1len(const struct msgb *msgb) 99:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 100:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->tail - (uint8_t *)msgb_l1(msgb); 101:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 102:../../shared/libosmocore/include/osmocom/core/msgb.h **** 103:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief determine length of L2 message 104:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 105:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns size of L2 message in bytes 106:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 107:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function computes the number of bytes between the tail of the 108:../../shared/libosmocore/include/osmocom/core/msgb.h **** * message and the layer 2 header. 109:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 110:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline unsigned int msgb_l2len(const struct msgb *msgb) 111:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 112:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->tail - (uint8_t *)msgb_l2(msgb); 113:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 114:../../shared/libosmocore/include/osmocom/core/msgb.h **** 115:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief determine length of L3 message 116:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 117:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns size of L3 message in bytes 118:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 119:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function computes the number of bytes between the tail of the 120:../../shared/libosmocore/include/osmocom/core/msgb.h **** * message and the layer 3 header. 121:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 122:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline unsigned int msgb_l3len(const struct msgb *msgb) 123:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 124:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->tail - (uint8_t *)msgb_l3(msgb); 125:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 126:../../shared/libosmocore/include/osmocom/core/msgb.h **** 127:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief determine the length of the header 128:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 129:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns number of bytes between start of buffer and start of msg 130:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 131:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function computes the length difference between the underlying 132:../../shared/libosmocore/include/osmocom/core/msgb.h **** * data buffer and the used section of the \a msgb. 133:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 134:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline unsigned int msgb_headlen(const struct msgb *msgb) 135:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 136:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->len - msgb->data_len; 137:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 138:../../shared/libosmocore/include/osmocom/core/msgb.h **** 139:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief determine how much tail room is left in msgb 140:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 141:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns number of bytes remaining at end of msgb 142:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 143:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function computes the amount of octets left in the underlying 144:../../shared/libosmocore/include/osmocom/core/msgb.h **** * data buffer after the end of the message. 145:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 146:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline int msgb_tailroom(const struct msgb *msgb) 147:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 148:../../shared/libosmocore/include/osmocom/core/msgb.h **** return (msgb->head + msgb->data_len) - msgb->tail; 149:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 150:../../shared/libosmocore/include/osmocom/core/msgb.h **** 151:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief determine the amount of headroom in msgb 152:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 153:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns number of bytes left ahead of message start in msgb 154:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 155:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function computes the amount of bytes left in the underlying 156:../../shared/libosmocore/include/osmocom/core/msgb.h **** * data buffer before the start of the actual message. 157:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 158:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline int msgb_headroom(const struct msgb *msgb) 159:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 160:../../shared/libosmocore/include/osmocom/core/msgb.h **** return (msgb->data - msgb->head); 161:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 162:../../shared/libosmocore/include/osmocom/core/msgb.h **** 163:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief append data to end of message buffer 164:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 165:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] len number of bytes to append to message 166:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns pointer to start of newly-appended data 167:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 168:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function will move the \a tail pointer of the message buffer \a 169:../../shared/libosmocore/include/osmocom/core/msgb.h **** * len bytes further, thus enlarging the message by \a len bytes. 170:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 171:../../shared/libosmocore/include/osmocom/core/msgb.h **** * The return value is a pointer to start of the newly added section at 172:../../shared/libosmocore/include/osmocom/core/msgb.h **** * the end of the message and can be used for actually filling/copying 173:../../shared/libosmocore/include/osmocom/core/msgb.h **** * data into it. 174:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 175:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline unsigned char *msgb_put(struct msgb *msgb, unsigned int len) 176:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 177:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *tmp = msgb->tail; 178:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (msgb_tailroom(msgb) < (int) len) 179:../../shared/libosmocore/include/osmocom/core/msgb.h **** MSGB_ABORT(msgb, "Not enough tailroom msgb_push (%u < %u)\n", 180:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_tailroom(msgb), len); 181:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->tail += len; 182:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->len += len; 183:../../shared/libosmocore/include/osmocom/core/msgb.h **** return tmp; 184:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 185:../../shared/libosmocore/include/osmocom/core/msgb.h **** 186:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief append a uint8 value to the end of the message 187:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 188:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] word unsigned 8bit byte to be appended 189:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 190:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline void msgb_put_u8(struct msgb *msgb, uint8_t word) 191:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 192:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 1); 193:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word & 0xFF; 194:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 195:../../shared/libosmocore/include/osmocom/core/msgb.h **** 196:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief append a uint16 value to the end of the message 197:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 198:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] word unsigned 16bit byte to be appended 199:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 200:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline void msgb_put_u16(struct msgb *msgb, uint16_t word) 201:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 202:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 2); 203:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word >> 8 & 0xFF; 204:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[1] = word & 0xFF; 205:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 206:../../shared/libosmocore/include/osmocom/core/msgb.h **** 207:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief append a uint32 value to the end of the message 208:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 209:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] word unsigned 32bit byte to be appended 210:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 211:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline void msgb_put_u32(struct msgb *msgb, uint32_t word) 212:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 213:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 4); 214:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word >> 24 & 0xFF; 215:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[1] = word >> 16 & 0xFF; 216:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[2] = word >> 8 & 0xFF; 217:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[3] = word & 0xFF; 218:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 219:../../shared/libosmocore/include/osmocom/core/msgb.h **** 220:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief remove data from end of message 221:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 222:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] len number of bytes to remove from end 223:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 224:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline unsigned char *msgb_get(struct msgb *msgb, unsigned int len) 225:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 226:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *tmp = msgb->data - len; 227:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (msgb_length(msgb) < len) 228:../../shared/libosmocore/include/osmocom/core/msgb.h **** MSGB_ABORT(msgb, "msgb too small to get %u (len %u)\n", 229:../../shared/libosmocore/include/osmocom/core/msgb.h **** len, msgb_length(msgb)); 230:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->tail -= len; 231:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->len -= len; 232:../../shared/libosmocore/include/osmocom/core/msgb.h **** return tmp; 233:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 234:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief remove uint8 from end of message 235:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 236:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns 8bit value taken from end of msgb 237:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 238:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline uint8_t msgb_get_u8(struct msgb *msgb) 239:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 240:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_get(msgb, 1); 241:../../shared/libosmocore/include/osmocom/core/msgb.h **** return space[0]; 242:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 243:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief remove uint16 from end of message 244:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 245:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns 16bit value taken from end of msgb 246:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 247:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline uint16_t msgb_get_u16(struct msgb *msgb) 248:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 249:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_get(msgb, 2); 250:../../shared/libosmocore/include/osmocom/core/msgb.h **** return space[0] << 8 | space[1]; 251:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 252:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief remove uint32 from end of message 253:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 254:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns 32bit value taken from end of msgb 255:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 256:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline uint32_t msgb_get_u32(struct msgb *msgb) 257:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 258:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_get(msgb, 4); 259:../../shared/libosmocore/include/osmocom/core/msgb.h **** return space[0] << 24 | space[1] << 16 | space[2] << 8 | space[3]; 260:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 261:../../shared/libosmocore/include/osmocom/core/msgb.h **** 262:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief prepend (push) some data to start of message 263:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 264:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] len number of bytes to pre-pend 265:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns pointer to newly added portion at start of \a msgb 266:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 267:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function moves the \a data pointer of the \ref msgb further 268:../../shared/libosmocore/include/osmocom/core/msgb.h **** * to the front (by \a len bytes), thereby enlarging the message by \a 269:../../shared/libosmocore/include/osmocom/core/msgb.h **** * len bytes. 270:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 271:../../shared/libosmocore/include/osmocom/core/msgb.h **** * The return value is a pointer to the newly added section in the 272:../../shared/libosmocore/include/osmocom/core/msgb.h **** * beginning of the message. It can be used to fill/copy data into it. 273:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 274:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline unsigned char *msgb_push(struct msgb *msgb, unsigned int len) 275:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 276:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (msgb_headroom(msgb) < (int) len) 277:../../shared/libosmocore/include/osmocom/core/msgb.h **** MSGB_ABORT(msgb, "Not enough headroom msgb_push (%u < %u)\n", 278:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_headroom(msgb), len); 279:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->data -= len; 280:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->len += len; 281:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data; 282:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 283:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief remove (pull) a header from the front of the message buffer 284:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 285:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] len number of octets to be pulled 286:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns pointer to new start of msgb 287:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 288:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function moves the \a data pointer of the \ref msgb further back 289:../../shared/libosmocore/include/osmocom/core/msgb.h **** * in the message, thereby shrinking the size of the message by \a len 290:../../shared/libosmocore/include/osmocom/core/msgb.h **** * bytes. 291:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 292:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline unsigned char *msgb_pull(struct msgb *msgb, unsigned int len) 293:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->len -= len; 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 296:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 297:../../shared/libosmocore/include/osmocom/core/msgb.h **** 298:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief remove uint8 from front of message 299:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 300:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns 8bit value taken from end of msgb 301:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 302:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline uint8_t msgb_pull_u8(struct msgb *msgb) 303:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 27 .loc 2 303 1 view -0 28 .cfi_startproc 29 @ Function supports interworking. 30 @ args = 0, pretend = 0, frame = 0 31 @ frame_needed = 0, uses_anonymous_args = 0 32 @ link register save eliminated. 304:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_pull(msgb, 1) - 1; 33 .loc 2 304 2 view .LVU1 34 .LBB38: 35 .LBI38: 292:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 36 .loc 2 292 30 view .LVU2 37 .LBB39: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 38 .loc 2 294 2 view .LVU3 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 39 .loc 2 294 12 is_stmt 0 view .LVU4 40 0000 B633D0E1 ldrh r3, [r0, #54] 41 0004 013043E2 sub r3, r3, #1 42 0008 B633C0E1 strh r3, [r0, #54] @ movhi 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 43 .loc 2 295 2 is_stmt 1 view .LVU5 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 44 .loc 2 295 13 is_stmt 0 view .LVU6 45 000c 403090E5 ldr r3, [r0, #64] 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 46 .loc 2 295 20 view .LVU7 47 0010 012083E2 add r2, r3, #1 48 0014 402080E5 str r2, [r0, #64] 49 .LVL1: 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 50 .loc 2 295 20 view .LVU8 51 .LBE39: 52 .LBE38: 305:../../shared/libosmocore/include/osmocom/core/msgb.h **** return space[0]; 53 .loc 2 305 2 is_stmt 1 view .LVU9 306:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 54 .loc 2 306 1 is_stmt 0 view .LVU10 55 0018 0000D3E5 ldrb r0, [r3] @ zero_extendqisi2 56 .LVL2: 57 .loc 2 306 1 view .LVU11 58 001c 1EFF2FE1 bx lr 59 .cfi_endproc 60 .LFE33: 62 .section .text.msgb_pull_u32,"ax",%progbits 63 .align 2 64 .syntax unified 65 .arm 67 msgb_pull_u32: 68 .LVL3: 69 .LFB35: 307:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief remove uint16 from front of message 308:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 309:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns 16bit value taken from end of msgb 310:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 311:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline uint16_t msgb_pull_u16(struct msgb *msgb) 312:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 313:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_pull(msgb, 2) - 2; 314:../../shared/libosmocore/include/osmocom/core/msgb.h **** return space[0] << 8 | space[1]; 315:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 316:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief remove uint32 from front of message 317:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msgb message buffer 318:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns 32bit value taken from end of msgb 319:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 320:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline uint32_t msgb_pull_u32(struct msgb *msgb) 321:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 70 .loc 2 321 1 is_stmt 1 view -0 71 .cfi_startproc 72 @ Function supports interworking. 73 @ args = 0, pretend = 0, frame = 0 74 @ frame_needed = 0, uses_anonymous_args = 0 75 @ link register save eliminated. 322:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_pull(msgb, 4) - 4; 76 .loc 2 322 2 view .LVU13 77 .LBB40: 78 .LBI40: 292:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 79 .loc 2 292 30 view .LVU14 80 .LBB41: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 81 .loc 2 294 2 view .LVU15 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 82 .loc 2 294 12 is_stmt 0 view .LVU16 83 0000 B633D0E1 ldrh r3, [r0, #54] 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 84 .loc 2 295 13 view .LVU17 85 0004 402090E5 ldr r2, [r0, #64] 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 86 .loc 2 294 12 view .LVU18 87 0008 043043E2 sub r3, r3, #4 88 000c B633C0E1 strh r3, [r0, #54] @ movhi 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 89 .loc 2 295 2 is_stmt 1 view .LVU19 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 90 .loc 2 295 20 is_stmt 0 view .LVU20 91 0010 043082E2 add r3, r2, #4 92 0014 403080E5 str r3, [r0, #64] 93 .LVL4: 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 94 .loc 2 295 20 view .LVU21 95 .LBE41: 96 .LBE40: 323:../../shared/libosmocore/include/osmocom/core/msgb.h **** return space[0] << 24 | space[1] << 16 | space[2] << 8 | space[3]; 97 .loc 2 323 2 is_stmt 1 view .LVU22 98 .loc 2 323 31 is_stmt 0 view .LVU23 99 0018 0130D2E5 ldrb r3, [r2, #1] @ zero_extendqisi2 100 .loc 2 323 14 view .LVU24 101 001c 0010D2E5 ldrb r1, [r2] @ zero_extendqisi2 102 .loc 2 323 35 view .LVU25 103 0020 0338A0E1 lsl r3, r3, #16 104 .loc 2 323 24 view .LVU26 105 0024 013C83E1 orr r3, r3, r1, lsl #24 106 .loc 2 323 64 view .LVU27 107 0028 0310D2E5 ldrb r1, [r2, #3] @ zero_extendqisi2 108 .loc 2 323 48 view .LVU28 109 002c 0200D2E5 ldrb r0, [r2, #2] @ zero_extendqisi2 110 .LVL5: 111 .loc 2 323 57 view .LVU29 112 0030 013083E1 orr r3, r3, r1 324:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 113 .loc 2 324 1 view .LVU30 114 0034 000483E1 orr r0, r3, r0, lsl #8 115 0038 1EFF2FE1 bx lr 116 .cfi_endproc 117 .LFE35: 119 .section .text.flush_uart,"ax",%progbits 120 .align 2 121 .syntax unified 122 .arm 124 flush_uart: 125 .LFB62: 1:apps/loader/main.c **** /* boot loader for Calypso phones */ 2:apps/loader/main.c **** 3:apps/loader/main.c **** /* (C) 2010 by Ingo Albrecht 4:apps/loader/main.c **** * 5:apps/loader/main.c **** * All Rights Reserved 6:apps/loader/main.c **** * 7:apps/loader/main.c **** * This program is free software; you can redistribute it and/or modify 8:apps/loader/main.c **** * it under the terms of the GNU General Public License as published by 9:apps/loader/main.c **** * the Free Software Foundation; either version 2 of the License, or 10:apps/loader/main.c **** * (at your option) any later version. 11:apps/loader/main.c **** * 12:apps/loader/main.c **** * This program is distributed in the hope that it will be useful, 13:apps/loader/main.c **** * but WITHOUT ANY WARRANTY; without even the implied warranty of 14:apps/loader/main.c **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15:apps/loader/main.c **** * GNU General Public License for more details. 16:apps/loader/main.c **** * 17:apps/loader/main.c **** */ 18:apps/loader/main.c **** 19:apps/loader/main.c **** #include 20:apps/loader/main.c **** #include 21:apps/loader/main.c **** #include 22:apps/loader/main.c **** 23:apps/loader/main.c **** #include 24:apps/loader/main.c **** #include 25:apps/loader/main.c **** #include 26:apps/loader/main.c **** #include 27:apps/loader/main.c **** #include 28:apps/loader/main.c **** #include 29:apps/loader/main.c **** #include 30:apps/loader/main.c **** #include 31:apps/loader/main.c **** 32:apps/loader/main.c **** #include 33:apps/loader/main.c **** 34:apps/loader/main.c **** #include 35:apps/loader/main.c **** #include 36:apps/loader/main.c **** 37:apps/loader/main.c **** #include 38:apps/loader/main.c **** 39:apps/loader/main.c **** #include 40:apps/loader/main.c **** #include 41:apps/loader/main.c **** #include 42:apps/loader/main.c **** #include 43:apps/loader/main.c **** #include 44:apps/loader/main.c **** #include 45:apps/loader/main.c **** #include 46:apps/loader/main.c **** #include 47:apps/loader/main.c **** #include 48:apps/loader/main.c **** 49:apps/loader/main.c **** #include 50:apps/loader/main.c **** 51:apps/loader/main.c **** #include "protocol.h" 52:apps/loader/main.c **** 53:apps/loader/main.c **** /* Main Program */ 54:apps/loader/main.c **** const char *hr = 55:apps/loader/main.c **** "======================================================================\n"; 56:apps/loader/main.c **** 57:apps/loader/main.c **** static void key_handler(enum key_codes code, enum key_states state); 58:apps/loader/main.c **** static void cmd_handler(uint8_t dlci, struct msgb *msg); 59:apps/loader/main.c **** 60:apps/loader/main.c **** int flag = 0; 61:apps/loader/main.c **** static int sercomm_uart; 62:apps/loader/main.c **** 63:apps/loader/main.c **** static void flush_uart(void) 64:apps/loader/main.c **** { 126 .loc 1 64 1 is_stmt 1 view -0 127 .cfi_startproc 128 @ Function supports interworking. 129 @ args = 0, pretend = 0, frame = 0 130 @ frame_needed = 0, uses_anonymous_args = 0 65:apps/loader/main.c **** unsigned i; 131 .loc 1 65 2 view .LVU32 66:apps/loader/main.c **** for (i = 0; i < 500; i++) { 132 .loc 1 66 2 view .LVU33 133 .LVL6: 134 .loc 1 66 16 view .LVU34 64:apps/loader/main.c **** unsigned i; 135 .loc 1 64 1 is_stmt 0 view .LVU35 136 0000 70402DE9 push {r4, r5, r6, lr} 137 .LCFI0: 138 .cfi_def_cfa_offset 16 139 .cfi_offset 4, -16 140 .cfi_offset 5, -12 141 .cfi_offset 6, -8 142 .cfi_offset 14, -4 64:apps/loader/main.c **** unsigned i; 143 .loc 1 64 1 view .LVU36 144 0004 7D4FA0E3 mov r4, #500 67:apps/loader/main.c **** uart_poll(sercomm_uart); 145 .loc 1 67 3 view .LVU37 146 0008 1C509FE5 ldr r5, .L7 147 .LVL7: 148 .L4: 149 .loc 1 67 3 is_stmt 1 discriminator 3 view .LVU38 150 000c 0000D5E5 ldrb r0, [r5] @ zero_extendqisi2 151 0010 FEFFFFEB bl uart_poll 152 .LVL8: 68:apps/loader/main.c **** delay_ms(1); 153 .loc 1 68 3 discriminator 3 view .LVU39 154 0014 0100A0E3 mov r0, #1 155 0018 FEFFFFEB bl delay_ms 156 .LVL9: 66:apps/loader/main.c **** uart_poll(sercomm_uart); 157 .loc 1 66 24 discriminator 3 view .LVU40 66:apps/loader/main.c **** uart_poll(sercomm_uart); 158 .loc 1 66 16 discriminator 3 view .LVU41 159 001c 014054E2 subs r4, r4, #1 160 .LVL10: 66:apps/loader/main.c **** uart_poll(sercomm_uart); 161 .loc 1 66 16 is_stmt 0 discriminator 3 view .LVU42 162 0020 F9FFFF1A bne .L4 69:apps/loader/main.c **** } 70:apps/loader/main.c **** } 163 .loc 1 70 1 view .LVU43 164 0024 7040BDE8 pop {r4, r5, r6, lr} 165 .LCFI1: 166 .cfi_restore 14 167 .cfi_restore 6 168 .cfi_restore 5 169 .cfi_restore 4 170 .cfi_def_cfa_offset 0 171 .LVL11: 172 .loc 1 70 1 view .LVU44 173 0028 1EFF2FE1 bx lr 174 .L8: 175 .align 2 176 .L7: 177 002c 00000000 .word .LANCHOR0 178 .cfi_endproc 179 .LFE62: 181 .section .rodata.str1.1,"aMS",%progbits,1 182 .LC0: 183 0000 6D736762 .ascii "msgb(%p): Not enough tailroom msgb_push (%u < %u)\012" 183 28257029 183 3A204E6F 183 7420656E 183 6F756768 184 0032 00 .ascii "\000" 185 .section .text.msgb_put,"ax",%progbits 186 .align 2 187 .syntax unified 188 .arm 190 msgb_put: 191 .LVL12: 192 .LFB23: 176:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *tmp = msgb->tail; 193 .loc 2 176 1 is_stmt 1 view -0 194 .cfi_startproc 195 @ Function supports interworking. 196 @ args = 0, pretend = 0, frame = 0 197 @ frame_needed = 0, uses_anonymous_args = 0 177:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (msgb_tailroom(msgb) < (int) len) 198 .loc 2 177 2 view .LVU46 199 .LBB44: 200 .LBB45: 148:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 201 .loc 2 148 27 is_stmt 0 view .LVU47 202 0000 B433D0E1 ldrh r3, [r0, #52] 148:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 203 .loc 2 148 21 view .LVU48 204 0004 382090E5 ldr r2, [r0, #56] 205 .LBE45: 206 .LBE44: 176:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *tmp = msgb->tail; 207 .loc 2 176 1 view .LVU49 208 0008 70402DE9 push {r4, r5, r6, lr} 209 .LCFI2: 210 .cfi_def_cfa_offset 16 211 .cfi_offset 4, -16 212 .cfi_offset 5, -12 213 .cfi_offset 6, -8 214 .cfi_offset 14, -4 177:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (msgb_tailroom(msgb) < (int) len) 215 .loc 2 177 17 view .LVU50 216 000c 3C6090E5 ldr r6, [r0, #60] 217 .LVL13: 178:../../shared/libosmocore/include/osmocom/core/msgb.h **** MSGB_ABORT(msgb, "Not enough tailroom msgb_push (%u < %u)\n", 218 .loc 2 178 2 is_stmt 1 view .LVU51 219 .LBB47: 220 .LBI44: 146:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 221 .loc 2 146 19 view .LVU52 222 .LBB46: 148:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 223 .loc 2 148 2 view .LVU53 148:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 224 .loc 2 148 21 is_stmt 0 view .LVU54 225 0010 032082E0 add r2, r2, r3 148:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 226 .loc 2 148 39 view .LVU55 227 0014 062042E0 sub r2, r2, r6 228 .LVL14: 148:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 229 .loc 2 148 39 view .LVU56 230 .LBE46: 231 .LBE47: 178:../../shared/libosmocore/include/osmocom/core/msgb.h **** MSGB_ABORT(msgb, "Not enough tailroom msgb_push (%u < %u)\n", 232 .loc 2 178 5 view .LVU57 233 0018 020051E1 cmp r1, r2 176:../../shared/libosmocore/include/osmocom/core/msgb.h **** unsigned char *tmp = msgb->tail; 234 .loc 2 176 1 view .LVU58 235 001c 0040A0E1 mov r4, r0 236 0020 0150A0E1 mov r5, r1 178:../../shared/libosmocore/include/osmocom/core/msgb.h **** MSGB_ABORT(msgb, "Not enough tailroom msgb_push (%u < %u)\n", 237 .loc 2 178 5 view .LVU59 238 0024 030000DA ble .L10 179:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_tailroom(msgb), len); 239 .loc 2 179 3 is_stmt 1 view .LVU60 179:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_tailroom(msgb), len); 240 .loc 2 179 3 view .LVU61 241 0028 0130A0E1 mov r3, r1 242 002c 0010A0E1 mov r1, r0 243 .LVL15: 179:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_tailroom(msgb), len); 244 .loc 2 179 3 is_stmt 0 view .LVU62 245 0030 24009FE5 ldr r0, .L12 246 .LVL16: 179:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_tailroom(msgb), len); 247 .loc 2 179 3 view .LVU63 248 0034 FEFFFFEB bl osmo_panic 249 .LVL17: 250 .L10: 179:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_tailroom(msgb), len); 251 .loc 2 179 3 is_stmt 1 discriminator 1 view .LVU64 181:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->len += len; 252 .loc 2 181 2 discriminator 1 view .LVU65 181:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb->len += len; 253 .loc 2 181 13 is_stmt 0 discriminator 1 view .LVU66 254 0038 3C3094E5 ldr r3, [r4, #60] 255 003c 053083E0 add r3, r3, r5 256 0040 3C3084E5 str r3, [r4, #60] 182:../../shared/libosmocore/include/osmocom/core/msgb.h **** return tmp; 257 .loc 2 182 2 is_stmt 1 discriminator 1 view .LVU67 182:../../shared/libosmocore/include/osmocom/core/msgb.h **** return tmp; 258 .loc 2 182 12 is_stmt 0 discriminator 1 view .LVU68 259 0044 B633D4E1 ldrh r3, [r4, #54] 260 0048 053083E0 add r3, r3, r5 184:../../shared/libosmocore/include/osmocom/core/msgb.h **** 261 .loc 2 184 1 discriminator 1 view .LVU69 262 004c 0600A0E1 mov r0, r6 182:../../shared/libosmocore/include/osmocom/core/msgb.h **** return tmp; 263 .loc 2 182 12 discriminator 1 view .LVU70 264 0050 B633C4E1 strh r3, [r4, #54] @ movhi 183:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 265 .loc 2 183 2 is_stmt 1 discriminator 1 view .LVU71 184:../../shared/libosmocore/include/osmocom/core/msgb.h **** 266 .loc 2 184 1 is_stmt 0 discriminator 1 view .LVU72 267 0054 7040BDE8 pop {r4, r5, r6, lr} 268 .LCFI3: 269 .cfi_restore 14 270 .cfi_restore 6 271 .cfi_restore 5 272 .cfi_restore 4 273 .cfi_def_cfa_offset 0 274 .LVL18: 184:../../shared/libosmocore/include/osmocom/core/msgb.h **** 275 .loc 2 184 1 discriminator 1 view .LVU73 276 0058 1EFF2FE1 bx lr 277 .L13: 278 .align 2 279 .L12: 280 005c 00000000 .word .LC0 281 .cfi_endproc 282 .LFE23: 284 .section .text.msgb_put_u16,"ax",%progbits 285 .align 2 286 .syntax unified 287 .arm 289 msgb_put_u16: 290 .LVL19: 291 .LFB25: 201:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 2); 292 .loc 2 201 1 is_stmt 1 view -0 293 .cfi_startproc 294 @ Function supports interworking. 295 @ args = 0, pretend = 0, frame = 0 296 @ frame_needed = 0, uses_anonymous_args = 0 202:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word >> 8 & 0xFF; 297 .loc 2 202 2 view .LVU75 201:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 2); 298 .loc 2 201 1 is_stmt 0 view .LVU76 299 0000 10402DE9 push {r4, lr} 300 .LCFI4: 301 .cfi_def_cfa_offset 8 302 .cfi_offset 4, -8 303 .cfi_offset 14, -4 201:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 2); 304 .loc 2 201 1 view .LVU77 305 0004 0140A0E1 mov r4, r1 202:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word >> 8 & 0xFF; 306 .loc 2 202 19 view .LVU78 307 0008 0210A0E3 mov r1, #2 308 .LVL20: 202:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word >> 8 & 0xFF; 309 .loc 2 202 19 view .LVU79 310 000c FEFFFFEB bl msgb_put 311 .LVL21: 203:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[1] = word & 0xFF; 312 .loc 2 203 2 is_stmt 1 view .LVU80 203:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[1] = word & 0xFF; 313 .loc 2 203 11 is_stmt 0 view .LVU81 314 0010 2434A0E1 lsr r3, r4, #8 315 0014 0030C0E5 strb r3, [r0] 204:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 316 .loc 2 204 2 is_stmt 1 view .LVU82 204:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 317 .loc 2 204 11 is_stmt 0 view .LVU83 318 0018 0140C0E5 strb r4, [r0, #1] 205:../../shared/libosmocore/include/osmocom/core/msgb.h **** 319 .loc 2 205 1 view .LVU84 320 001c 1040BDE8 pop {r4, lr} 321 .LCFI5: 322 .cfi_restore 14 323 .cfi_restore 4 324 .cfi_def_cfa_offset 0 325 0020 1EFF2FE1 bx lr 326 .cfi_endproc 327 .LFE25: 329 .section .text.msgb_put_u8,"ax",%progbits 330 .align 2 331 .syntax unified 332 .arm 334 msgb_put_u8: 335 .LVL22: 336 .LFB24: 191:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 1); 337 .loc 2 191 1 is_stmt 1 view -0 338 .cfi_startproc 339 @ Function supports interworking. 340 @ args = 0, pretend = 0, frame = 0 341 @ frame_needed = 0, uses_anonymous_args = 0 192:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word & 0xFF; 342 .loc 2 192 2 view .LVU86 191:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 1); 343 .loc 2 191 1 is_stmt 0 view .LVU87 344 0000 10402DE9 push {r4, lr} 345 .LCFI6: 346 .cfi_def_cfa_offset 8 347 .cfi_offset 4, -8 348 .cfi_offset 14, -4 191:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 1); 349 .loc 2 191 1 view .LVU88 350 0004 0140A0E1 mov r4, r1 192:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word & 0xFF; 351 .loc 2 192 19 view .LVU89 352 0008 0110A0E3 mov r1, #1 353 .LVL23: 192:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word & 0xFF; 354 .loc 2 192 19 view .LVU90 355 000c FEFFFFEB bl msgb_put 356 .LVL24: 193:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 357 .loc 2 193 2 is_stmt 1 view .LVU91 193:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 358 .loc 2 193 11 is_stmt 0 view .LVU92 359 0010 0040C0E5 strb r4, [r0] 194:../../shared/libosmocore/include/osmocom/core/msgb.h **** 360 .loc 2 194 1 view .LVU93 361 0014 1040BDE8 pop {r4, lr} 362 .LCFI7: 363 .cfi_restore 14 364 .cfi_restore 4 365 .cfi_def_cfa_offset 0 366 0018 1EFF2FE1 bx lr 367 .cfi_endproc 368 .LFE24: 370 .section .text.loader_send_simple,"ax",%progbits 371 .align 2 372 .syntax unified 373 .arm 375 loader_send_simple: 376 .LVL25: 377 .LFB67: 71:apps/loader/main.c **** 72:apps/loader/main.c **** static void device_poweroff(void) 73:apps/loader/main.c **** { 74:apps/loader/main.c **** flush_uart(); 75:apps/loader/main.c **** twl3025_power_off(); 76:apps/loader/main.c **** } 77:apps/loader/main.c **** 78:apps/loader/main.c **** static void device_reset(void) 79:apps/loader/main.c **** { 80:apps/loader/main.c **** flush_uart(); 81:apps/loader/main.c **** wdog_reset(); 82:apps/loader/main.c **** } 83:apps/loader/main.c **** 84:apps/loader/main.c **** static void device_enter_loader(unsigned char bootrom) 85:apps/loader/main.c **** { 86:apps/loader/main.c **** flush_uart(); 87:apps/loader/main.c **** 88:apps/loader/main.c **** calypso_bootrom(bootrom); 89:apps/loader/main.c **** void (*entry) (void) = (void (*)(void))0; 90:apps/loader/main.c **** entry(); 91:apps/loader/main.c **** } 92:apps/loader/main.c **** 93:apps/loader/main.c **** static void device_jump(void *entry) 94:apps/loader/main.c **** { 95:apps/loader/main.c **** flush_uart(); 96:apps/loader/main.c **** 97:apps/loader/main.c **** void (*f) (void) = (void (*)(void))entry; 98:apps/loader/main.c **** f(); 99:apps/loader/main.c **** } 100:apps/loader/main.c **** 101:apps/loader/main.c **** static void loader_send_simple(struct msgb *msg, uint8_t dlci, uint8_t command) 102:apps/loader/main.c **** { 378 .loc 1 102 1 is_stmt 1 view -0 379 .cfi_startproc 380 @ Function supports interworking. 381 @ args = 0, pretend = 0, frame = 0 382 @ frame_needed = 0, uses_anonymous_args = 0 103:apps/loader/main.c **** msgb_put_u8(msg, command); 383 .loc 1 103 2 view .LVU95 102:apps/loader/main.c **** msgb_put_u8(msg, command); 384 .loc 1 102 1 is_stmt 0 view .LVU96 385 0000 70402DE9 push {r4, r5, r6, lr} 386 .LCFI8: 387 .cfi_def_cfa_offset 16 388 .cfi_offset 4, -16 389 .cfi_offset 5, -12 390 .cfi_offset 6, -8 391 .cfi_offset 14, -4 102:apps/loader/main.c **** msgb_put_u8(msg, command); 392 .loc 1 102 1 view .LVU97 393 0004 0050A0E1 mov r5, r0 394 0008 0140A0E1 mov r4, r1 395 .loc 1 103 2 view .LVU98 396 000c 0210A0E1 mov r1, r2 397 .LVL26: 398 .loc 1 103 2 view .LVU99 399 0010 FEFFFFEB bl msgb_put_u8 400 .LVL27: 104:apps/loader/main.c **** sercomm_sendmsg(dlci, msg); 401 .loc 1 104 2 is_stmt 1 view .LVU100 402 0014 0510A0E1 mov r1, r5 403 0018 0400A0E1 mov r0, r4 404 001c FEFFFFEB bl sercomm_sendmsg 405 .LVL28: 105:apps/loader/main.c **** } 406 .loc 1 105 1 is_stmt 0 view .LVU101 407 0020 7040BDE8 pop {r4, r5, r6, lr} 408 .LCFI9: 409 .cfi_restore 14 410 .cfi_restore 6 411 .cfi_restore 5 412 .cfi_restore 4 413 .cfi_def_cfa_offset 0 414 .LVL29: 415 .loc 1 105 1 view .LVU102 416 0024 1EFF2FE1 bx lr 417 .cfi_endproc 418 .LFE67: 420 .section .text.msgb_put_u32,"ax",%progbits 421 .align 2 422 .syntax unified 423 .arm 425 msgb_put_u32: 426 .LVL30: 427 .LFB26: 212:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 4); 428 .loc 2 212 1 is_stmt 1 view -0 429 .cfi_startproc 430 @ Function supports interworking. 431 @ args = 0, pretend = 0, frame = 0 432 @ frame_needed = 0, uses_anonymous_args = 0 213:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word >> 24 & 0xFF; 433 .loc 2 213 2 view .LVU104 212:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 4); 434 .loc 2 212 1 is_stmt 0 view .LVU105 435 0000 10402DE9 push {r4, lr} 436 .LCFI10: 437 .cfi_def_cfa_offset 8 438 .cfi_offset 4, -8 439 .cfi_offset 14, -4 212:../../shared/libosmocore/include/osmocom/core/msgb.h **** uint8_t *space = msgb_put(msgb, 4); 440 .loc 2 212 1 view .LVU106 441 0004 0140A0E1 mov r4, r1 213:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word >> 24 & 0xFF; 442 .loc 2 213 19 view .LVU107 443 0008 0410A0E3 mov r1, #4 444 .LVL31: 213:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[0] = word >> 24 & 0xFF; 445 .loc 2 213 19 view .LVU108 446 000c FEFFFFEB bl msgb_put 447 .LVL32: 214:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[1] = word >> 16 & 0xFF; 448 .loc 2 214 2 is_stmt 1 view .LVU109 214:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[1] = word >> 16 & 0xFF; 449 .loc 2 214 18 is_stmt 0 view .LVU110 450 0010 243CA0E1 lsr r3, r4, #24 214:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[1] = word >> 16 & 0xFF; 451 .loc 2 214 11 view .LVU111 452 0014 0030C0E5 strb r3, [r0] 215:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[2] = word >> 8 & 0xFF; 453 .loc 2 215 2 is_stmt 1 view .LVU112 215:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[2] = word >> 8 & 0xFF; 454 .loc 2 215 18 is_stmt 0 view .LVU113 455 0018 2438A0E1 lsr r3, r4, #16 215:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[2] = word >> 8 & 0xFF; 456 .loc 2 215 11 view .LVU114 457 001c 0130C0E5 strb r3, [r0, #1] 216:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[3] = word & 0xFF; 458 .loc 2 216 2 is_stmt 1 view .LVU115 216:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[3] = word & 0xFF; 459 .loc 2 216 18 is_stmt 0 view .LVU116 460 0020 2434A0E1 lsr r3, r4, #8 216:../../shared/libosmocore/include/osmocom/core/msgb.h **** space[3] = word & 0xFF; 461 .loc 2 216 11 view .LVU117 462 0024 0230C0E5 strb r3, [r0, #2] 217:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 463 .loc 2 217 2 is_stmt 1 view .LVU118 217:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 464 .loc 2 217 11 is_stmt 0 view .LVU119 465 0028 0340C0E5 strb r4, [r0, #3] 218:../../shared/libosmocore/include/osmocom/core/msgb.h **** 466 .loc 2 218 1 view .LVU120 467 002c 1040BDE8 pop {r4, lr} 468 .LCFI11: 469 .cfi_restore 14 470 .cfi_restore 4 471 .cfi_def_cfa_offset 0 472 .LVL33: 218:../../shared/libosmocore/include/osmocom/core/msgb.h **** 473 .loc 2 218 1 view .LVU121 474 0030 1EFF2FE1 bx lr 475 .cfi_endproc 476 .LFE26: 478 .section .rodata.str1.1 479 .LC1: 480 0033 506F7765 .ascii "Powering off due to keypress.\012\000" 480 72696E67 480 206F6666 480 20647565 480 20746F20 481 .LC2: 482 0052 52657365 .ascii "Resetting due to keypress.\012\000" 482 7474696E 482 67206475 482 6520746F 482 206B6579 483 .section .text.key_handler,"ax",%progbits 484 .align 2 485 .syntax unified 486 .arm 488 key_handler: 489 .LVL34: 490 .LFB71: 106:apps/loader/main.c **** 107:apps/loader/main.c **** extern unsigned char _start; 108:apps/loader/main.c **** 109:apps/loader/main.c **** static void loader_send_init(uint8_t dlci) 110:apps/loader/main.c **** { 111:apps/loader/main.c **** struct msgb *msg = sercomm_alloc_msgb(9); 112:apps/loader/main.c **** msgb_put_u8(msg, LOADER_INIT); 113:apps/loader/main.c **** msgb_put_u32(msg, 0); 114:apps/loader/main.c **** msgb_put_u32(msg, (uint32_t)&_start); 115:apps/loader/main.c **** sercomm_sendmsg(dlci, msg); 116:apps/loader/main.c **** } 117:apps/loader/main.c **** 118:apps/loader/main.c **** flash_t the_flash; 119:apps/loader/main.c **** 120:apps/loader/main.c **** extern void putchar_asm(uint32_t c); 121:apps/loader/main.c **** 122:apps/loader/main.c **** static const uint8_t phone_ack[] = { 0x1b, 0xf6, 0x02, 0x00, 0x41, 0x03, 0x42 }; 123:apps/loader/main.c **** 124:apps/loader/main.c **** int main(void) 125:apps/loader/main.c **** { 126:apps/loader/main.c **** /* Simulate a compal loader saying "ACK" */ 127:apps/loader/main.c **** unsigned i = 0; 128:apps/loader/main.c **** for (i = 0; i < sizeof(phone_ack); i++) { 129:apps/loader/main.c **** putchar_asm(phone_ack[i]); 130:apps/loader/main.c **** } 131:apps/loader/main.c **** 132:apps/loader/main.c **** /* initialize board without interrupts */ 133:apps/loader/main.c **** board_init(0); 134:apps/loader/main.c **** sercomm_uart = sercomm_get_uart(); 135:apps/loader/main.c **** 136:apps/loader/main.c **** /* Say hi */ 137:apps/loader/main.c **** puts("\n\nOsmocomBB Loader (revision " GIT_REVISION ")\n"); 138:apps/loader/main.c **** puts(hr); 139:apps/loader/main.c **** 140:apps/loader/main.c **** fb_clear(); 141:apps/loader/main.c **** 142:apps/loader/main.c **** fb_setfg(FB_COLOR_BLACK); 143:apps/loader/main.c **** fb_setbg(FB_COLOR_WHITE); 144:apps/loader/main.c **** fb_setfont(FB_FONT_HELVB14); 145:apps/loader/main.c **** 146:apps/loader/main.c **** fb_gotoxy(2,20); 147:apps/loader/main.c **** fb_putstr("loader",framebuffer->width-4); 148:apps/loader/main.c **** 149:apps/loader/main.c **** fb_setfg(FB_COLOR_RED); 150:apps/loader/main.c **** fb_setbg(FB_COLOR_BLUE); 151:apps/loader/main.c **** 152:apps/loader/main.c **** fb_gotoxy(2,25); 153:apps/loader/main.c **** fb_boxto(framebuffer->width-3,38); 154:apps/loader/main.c **** 155:apps/loader/main.c **** fb_setfg(FB_COLOR_WHITE); 156:apps/loader/main.c **** fb_setfont(FB_FONT_HELVR08); 157:apps/loader/main.c **** fb_gotoxy(8,33); 158:apps/loader/main.c **** fb_putstr("osmocom-bb",framebuffer->width-4); 159:apps/loader/main.c **** 160:apps/loader/main.c **** fb_flush(); 161:apps/loader/main.c **** 162:apps/loader/main.c **** /* Identify environment */ 163:apps/loader/main.c **** printf("Running on %s in environment %s\n", manifest_board, 164:apps/loader/main.c **** manifest_environment); 165:apps/loader/main.c **** 166:apps/loader/main.c **** /* Initialize flash driver */ 167:apps/loader/main.c **** if (flash_init(&the_flash, 0)) { 168:apps/loader/main.c **** puts("Failed to initialize flash!\n"); 169:apps/loader/main.c **** } else { 170:apps/loader/main.c **** printf("Found flash of %zu bytes at 0x%p with %zu regions\n", 171:apps/loader/main.c **** the_flash.f_size, the_flash.f_base, 172:apps/loader/main.c **** the_flash.f_nregions); 173:apps/loader/main.c **** 174:apps/loader/main.c **** for (i = 0; i < the_flash.f_nregions; i++) { 175:apps/loader/main.c **** printf(" Region %d of %zu pages with %zu bytes each.\n", 176:apps/loader/main.c **** i, 177:apps/loader/main.c **** the_flash.f_regions[i].fr_bnum, 178:apps/loader/main.c **** the_flash.f_regions[i].fr_bsize); 179:apps/loader/main.c **** } 180:apps/loader/main.c **** 181:apps/loader/main.c **** } 182:apps/loader/main.c **** 183:apps/loader/main.c **** /* Set up a key handler for powering off */ 184:apps/loader/main.c **** keypad_set_handler(&key_handler); 185:apps/loader/main.c **** 186:apps/loader/main.c **** /* Set up loader communications */ 187:apps/loader/main.c **** sercomm_register_rx_cb(SC_DLCI_LOADER, &cmd_handler); 188:apps/loader/main.c **** 189:apps/loader/main.c **** /* Notify any running osmoload about our startup */ 190:apps/loader/main.c **** loader_send_init(SC_DLCI_LOADER); 191:apps/loader/main.c **** 192:apps/loader/main.c **** /* Wait for events */ 193:apps/loader/main.c **** while (1) { 194:apps/loader/main.c **** keypad_poll(); 195:apps/loader/main.c **** uart_poll(sercomm_uart); 196:apps/loader/main.c **** } 197:apps/loader/main.c **** 198:apps/loader/main.c **** /* NOT REACHED */ 199:apps/loader/main.c **** 200:apps/loader/main.c **** twl3025_power_off(); 201:apps/loader/main.c **** } 202:apps/loader/main.c **** 203:apps/loader/main.c **** static void cmd_handler(uint8_t dlci, struct msgb *msg) 204:apps/loader/main.c **** { 205:apps/loader/main.c **** if (msg->data_len < 1) { 206:apps/loader/main.c **** return; 207:apps/loader/main.c **** } 208:apps/loader/main.c **** 209:apps/loader/main.c **** uint8_t command = msgb_pull_u8(msg); 210:apps/loader/main.c **** 211:apps/loader/main.c **** int res = 0; 212:apps/loader/main.c **** 213:apps/loader/main.c **** flash_lock_t lock; 214:apps/loader/main.c **** 215:apps/loader/main.c **** void *data; 216:apps/loader/main.c **** 217:apps/loader/main.c **** uint8_t chip; 218:apps/loader/main.c **** uint8_t nbytes; 219:apps/loader/main.c **** uint16_t crc, mycrc; 220:apps/loader/main.c **** uint32_t address; 221:apps/loader/main.c **** 222:apps/loader/main.c **** struct msgb *reply = sercomm_alloc_msgb(256); // XXX 223:apps/loader/main.c **** 224:apps/loader/main.c **** if (!reply) { 225:apps/loader/main.c **** printf("Failed to allocate reply buffer!\n"); 226:apps/loader/main.c **** goto out; 227:apps/loader/main.c **** } 228:apps/loader/main.c **** 229:apps/loader/main.c **** switch (command) { 230:apps/loader/main.c **** 231:apps/loader/main.c **** case LOADER_PING: 232:apps/loader/main.c **** loader_send_simple(reply, dlci, LOADER_PING); 233:apps/loader/main.c **** break; 234:apps/loader/main.c **** 235:apps/loader/main.c **** case LOADER_RESET: 236:apps/loader/main.c **** loader_send_simple(reply, dlci, LOADER_RESET); 237:apps/loader/main.c **** device_reset(); 238:apps/loader/main.c **** break; 239:apps/loader/main.c **** 240:apps/loader/main.c **** case LOADER_POWEROFF: 241:apps/loader/main.c **** loader_send_simple(reply, dlci, LOADER_POWEROFF); 242:apps/loader/main.c **** device_poweroff(); 243:apps/loader/main.c **** break; 244:apps/loader/main.c **** 245:apps/loader/main.c **** case LOADER_ENTER_ROM_LOADER: 246:apps/loader/main.c **** loader_send_simple(reply, dlci, LOADER_ENTER_ROM_LOADER); 247:apps/loader/main.c **** device_enter_loader(1); 248:apps/loader/main.c **** break; 249:apps/loader/main.c **** 250:apps/loader/main.c **** case LOADER_ENTER_FLASH_LOADER: 251:apps/loader/main.c **** loader_send_simple(reply, dlci, LOADER_ENTER_FLASH_LOADER); 252:apps/loader/main.c **** device_enter_loader(0); 253:apps/loader/main.c **** break; 254:apps/loader/main.c **** 255:apps/loader/main.c **** case LOADER_MEM_READ: 256:apps/loader/main.c **** 257:apps/loader/main.c **** nbytes = msgb_pull_u8(msg); 258:apps/loader/main.c **** address = msgb_pull_u32(msg); 259:apps/loader/main.c **** 260:apps/loader/main.c **** crc = osmo_crc16(0, (void *)address, nbytes); 261:apps/loader/main.c **** 262:apps/loader/main.c **** msgb_put_u8(reply, LOADER_MEM_READ); 263:apps/loader/main.c **** msgb_put_u8(reply, nbytes); 264:apps/loader/main.c **** msgb_put_u16(reply, crc); 265:apps/loader/main.c **** msgb_put_u32(reply, address); 266:apps/loader/main.c **** 267:apps/loader/main.c **** memcpy(msgb_put(reply, nbytes), (void *)address, nbytes); 268:apps/loader/main.c **** 269:apps/loader/main.c **** sercomm_sendmsg(dlci, reply); 270:apps/loader/main.c **** 271:apps/loader/main.c **** break; 272:apps/loader/main.c **** 273:apps/loader/main.c **** case LOADER_MEM_WRITE: 274:apps/loader/main.c **** 275:apps/loader/main.c **** nbytes = msgb_pull_u8(msg); 276:apps/loader/main.c **** crc = msgb_pull_u16(msg); 277:apps/loader/main.c **** address = msgb_pull_u32(msg); 278:apps/loader/main.c **** 279:apps/loader/main.c **** data = msgb_pull(msg, nbytes) - nbytes; 280:apps/loader/main.c **** 281:apps/loader/main.c **** mycrc = osmo_crc16(0, data, nbytes); 282:apps/loader/main.c **** 283:apps/loader/main.c **** if (mycrc == crc) { 284:apps/loader/main.c **** memcpy((void *)address, data, nbytes); 285:apps/loader/main.c **** } 286:apps/loader/main.c **** 287:apps/loader/main.c **** msgb_put_u8(reply, LOADER_MEM_WRITE); 288:apps/loader/main.c **** msgb_put_u8(reply, nbytes); 289:apps/loader/main.c **** msgb_put_u16(reply, mycrc); 290:apps/loader/main.c **** msgb_put_u32(reply, address); 291:apps/loader/main.c **** 292:apps/loader/main.c **** sercomm_sendmsg(dlci, reply); 293:apps/loader/main.c **** 294:apps/loader/main.c **** break; 295:apps/loader/main.c **** 296:apps/loader/main.c **** case LOADER_JUMP: 297:apps/loader/main.c **** 298:apps/loader/main.c **** address = msgb_pull_u32(msg); 299:apps/loader/main.c **** 300:apps/loader/main.c **** msgb_put_u8(reply, LOADER_JUMP); 301:apps/loader/main.c **** msgb_put_u32(reply, address); 302:apps/loader/main.c **** 303:apps/loader/main.c **** sercomm_sendmsg(dlci, reply); 304:apps/loader/main.c **** 305:apps/loader/main.c **** device_jump((void *)address); 306:apps/loader/main.c **** 307:apps/loader/main.c **** break; 308:apps/loader/main.c **** 309:apps/loader/main.c **** case LOADER_FLASH_INFO: 310:apps/loader/main.c **** 311:apps/loader/main.c **** msgb_put_u8(reply, LOADER_FLASH_INFO); 312:apps/loader/main.c **** msgb_put_u8(reply, 1); // nchips 313:apps/loader/main.c **** 314:apps/loader/main.c **** // chip 1 315:apps/loader/main.c **** msgb_put_u32(reply, (uint32_t)the_flash.f_base); 316:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_size); 317:apps/loader/main.c **** msgb_put_u8(reply, the_flash.f_nregions); 318:apps/loader/main.c **** 319:apps/loader/main.c **** unsigned i; 320:apps/loader/main.c **** for (i = 0; i < the_flash.f_nregions; i++) { 321:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_regions[i].fr_bnum); 322:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_regions[i].fr_bsize); 323:apps/loader/main.c **** } 324:apps/loader/main.c **** 325:apps/loader/main.c **** sercomm_sendmsg(dlci, reply); 326:apps/loader/main.c **** 327:apps/loader/main.c **** break; 328:apps/loader/main.c **** 329:apps/loader/main.c **** case LOADER_FLASH_ERASE: 330:apps/loader/main.c **** case LOADER_FLASH_UNLOCK: 331:apps/loader/main.c **** case LOADER_FLASH_LOCK: 332:apps/loader/main.c **** case LOADER_FLASH_LOCKDOWN: 333:apps/loader/main.c **** 334:apps/loader/main.c **** chip = msgb_pull_u8(msg); 335:apps/loader/main.c **** address = msgb_pull_u32(msg); 336:apps/loader/main.c **** 337:apps/loader/main.c **** if (command == LOADER_FLASH_ERASE) { 338:apps/loader/main.c **** res = flash_block_erase(&the_flash, address); 339:apps/loader/main.c **** } 340:apps/loader/main.c **** if (command == LOADER_FLASH_UNLOCK) { 341:apps/loader/main.c **** res = flash_block_unlock(&the_flash, address); 342:apps/loader/main.c **** } 343:apps/loader/main.c **** if (command == LOADER_FLASH_LOCK) { 344:apps/loader/main.c **** res = flash_block_lock(&the_flash, address); 345:apps/loader/main.c **** } 346:apps/loader/main.c **** if (command == LOADER_FLASH_LOCKDOWN) { 347:apps/loader/main.c **** res = flash_block_lockdown(&the_flash, address); 348:apps/loader/main.c **** } 349:apps/loader/main.c **** 350:apps/loader/main.c **** msgb_put_u8(reply, command); 351:apps/loader/main.c **** msgb_put_u8(reply, chip); 352:apps/loader/main.c **** msgb_put_u32(reply, address); 353:apps/loader/main.c **** msgb_put_u32(reply, (res != 0)); 354:apps/loader/main.c **** 355:apps/loader/main.c **** sercomm_sendmsg(dlci, reply); 356:apps/loader/main.c **** 357:apps/loader/main.c **** break; 358:apps/loader/main.c **** 359:apps/loader/main.c **** case LOADER_FLASH_GETLOCK: 360:apps/loader/main.c **** 361:apps/loader/main.c **** chip = msgb_pull_u8(msg); 362:apps/loader/main.c **** address = msgb_pull_u32(msg); 363:apps/loader/main.c **** 364:apps/loader/main.c **** lock = flash_block_getlock(&the_flash, address); 365:apps/loader/main.c **** 366:apps/loader/main.c **** msgb_put_u8(reply, command); 367:apps/loader/main.c **** msgb_put_u8(reply, chip); 368:apps/loader/main.c **** msgb_put_u32(reply, address); 369:apps/loader/main.c **** 370:apps/loader/main.c **** switch (lock) { 371:apps/loader/main.c **** case FLASH_UNLOCKED: 372:apps/loader/main.c **** msgb_put_u32(reply, LOADER_FLASH_UNLOCKED); 373:apps/loader/main.c **** break; 374:apps/loader/main.c **** case FLASH_LOCKED: 375:apps/loader/main.c **** msgb_put_u32(reply, LOADER_FLASH_LOCKED); 376:apps/loader/main.c **** break; 377:apps/loader/main.c **** case FLASH_LOCKED_DOWN: 378:apps/loader/main.c **** msgb_put_u32(reply, LOADER_FLASH_LOCKED_DOWN); 379:apps/loader/main.c **** break; 380:apps/loader/main.c **** default: 381:apps/loader/main.c **** msgb_put_u32(reply, 0xFFFFFFFF); 382:apps/loader/main.c **** break; 383:apps/loader/main.c **** } 384:apps/loader/main.c **** 385:apps/loader/main.c **** sercomm_sendmsg(dlci, reply); 386:apps/loader/main.c **** 387:apps/loader/main.c **** break; 388:apps/loader/main.c **** 389:apps/loader/main.c **** case LOADER_FLASH_PROGRAM: 390:apps/loader/main.c **** 391:apps/loader/main.c **** nbytes = msgb_pull_u8(msg); 392:apps/loader/main.c **** crc = msgb_pull_u16(msg); 393:apps/loader/main.c **** msgb_pull_u8(msg); // XXX align 394:apps/loader/main.c **** chip = msgb_pull_u8(msg); 395:apps/loader/main.c **** address = msgb_pull_u32(msg); 396:apps/loader/main.c **** 397:apps/loader/main.c **** data = msgb_pull(msg, nbytes) - nbytes; 398:apps/loader/main.c **** 399:apps/loader/main.c **** mycrc = osmo_crc16(0, data, nbytes); 400:apps/loader/main.c **** 401:apps/loader/main.c **** if (mycrc == crc) { 402:apps/loader/main.c **** res = flash_program(&the_flash, address, data, nbytes); 403:apps/loader/main.c **** } 404:apps/loader/main.c **** 405:apps/loader/main.c **** msgb_put_u8(reply, LOADER_FLASH_PROGRAM); 406:apps/loader/main.c **** msgb_put_u8(reply, nbytes); 407:apps/loader/main.c **** msgb_put_u16(reply, mycrc); 408:apps/loader/main.c **** msgb_put_u8(reply, 0); // XXX align 409:apps/loader/main.c **** msgb_put_u8(reply, chip); 410:apps/loader/main.c **** msgb_put_u32(reply, address); 411:apps/loader/main.c **** 412:apps/loader/main.c **** msgb_put_u32(reply, (uint32_t) res); // XXX 413:apps/loader/main.c **** 414:apps/loader/main.c **** sercomm_sendmsg(dlci, reply); 415:apps/loader/main.c **** 416:apps/loader/main.c **** break; 417:apps/loader/main.c **** 418:apps/loader/main.c **** default: 419:apps/loader/main.c **** printf("unknown command %d\n", command); 420:apps/loader/main.c **** 421:apps/loader/main.c **** msgb_free(reply); 422:apps/loader/main.c **** 423:apps/loader/main.c **** break; 424:apps/loader/main.c **** } 425:apps/loader/main.c **** 426:apps/loader/main.c **** out: 427:apps/loader/main.c **** 428:apps/loader/main.c **** msgb_free(msg); 429:apps/loader/main.c **** } 430:apps/loader/main.c **** 431:apps/loader/main.c **** static void key_handler(enum key_codes code, enum key_states state) 432:apps/loader/main.c **** { 491 .loc 1 432 1 is_stmt 1 view -0 492 .cfi_startproc 493 @ Function supports interworking. 494 @ args = 0, pretend = 0, frame = 0 495 @ frame_needed = 0, uses_anonymous_args = 0 433:apps/loader/main.c **** if (state != PRESSED) 496 .loc 1 433 2 view .LVU123 497 .loc 1 433 5 is_stmt 0 view .LVU124 498 0000 000051E3 cmp r1, #0 499 0004 1EFF2F11 bxne lr 434:apps/loader/main.c **** return; 435:apps/loader/main.c **** 436:apps/loader/main.c **** switch (code) { 500 .loc 1 436 2 is_stmt 1 view .LVU125 501 0008 130050E3 cmp r0, #19 432:apps/loader/main.c **** if (state != PRESSED) 502 .loc 1 432 1 is_stmt 0 view .LVU126 503 000c 10402DE9 push {r4, lr} 504 .LCFI12: 505 .cfi_def_cfa_offset 8 506 .cfi_offset 4, -8 507 .cfi_offset 14, -4 508 .loc 1 436 2 view .LVU127 509 0010 0700000A beq .L24 510 0014 140050E3 cmp r0, #20 511 0018 0300001A bne .L22 437:apps/loader/main.c **** case KEY_POWER: 438:apps/loader/main.c **** puts("Powering off due to keypress.\n"); 512 .loc 1 438 3 is_stmt 1 view .LVU128 513 001c 24009FE5 ldr r0, .L29 514 .LVL35: 515 .loc 1 438 3 is_stmt 0 view .LVU129 516 0020 FEFFFFEB bl puts 517 .LVL36: 439:apps/loader/main.c **** device_poweroff(); 518 .loc 1 439 3 is_stmt 1 view .LVU130 519 .LBB54: 520 .LBI54: 72:apps/loader/main.c **** { 521 .loc 1 72 13 view .LVU131 522 .LBB55: 74:apps/loader/main.c **** twl3025_power_off(); 523 .loc 1 74 2 view .LVU132 524 0024 FEFFFFEB bl flush_uart 525 .LVL37: 75:apps/loader/main.c **** } 526 .loc 1 75 2 view .LVU133 527 0028 FEFFFFEB bl twl3025_power_off 528 .LVL38: 529 .L22: 530 .LBE55: 531 .LBE54: 440:apps/loader/main.c **** break; 441:apps/loader/main.c **** case KEY_OK: 442:apps/loader/main.c **** puts("Resetting due to keypress.\n"); 443:apps/loader/main.c **** device_reset(); 444:apps/loader/main.c **** break; 445:apps/loader/main.c **** default: 446:apps/loader/main.c **** break; 447:apps/loader/main.c **** } 448:apps/loader/main.c **** } 532 .loc 1 448 1 is_stmt 0 view .LVU134 533 002c 1040BDE8 pop {r4, lr} 534 .LCFI13: 535 .cfi_remember_state 536 .cfi_restore 14 537 .cfi_restore 4 538 .cfi_def_cfa_offset 0 539 0030 1EFF2FE1 bx lr 540 .LVL39: 541 .L24: 542 .LCFI14: 543 .cfi_restore_state 544 .LBB56: 545 .LBI56: 431:apps/loader/main.c **** { 546 .loc 1 431 13 is_stmt 1 view .LVU135 547 .LBB57: 442:apps/loader/main.c **** device_reset(); 548 .loc 1 442 3 view .LVU136 549 0034 10009FE5 ldr r0, .L29+4 550 .LVL40: 442:apps/loader/main.c **** device_reset(); 551 .loc 1 442 3 is_stmt 0 view .LVU137 552 0038 FEFFFFEB bl puts 553 .LVL41: 443:apps/loader/main.c **** break; 554 .loc 1 443 3 is_stmt 1 view .LVU138 555 .LBB58: 556 .LBI58: 78:apps/loader/main.c **** { 557 .loc 1 78 13 view .LVU139 558 .LBB59: 80:apps/loader/main.c **** wdog_reset(); 559 .loc 1 80 2 view .LVU140 560 003c FEFFFFEB bl flush_uart 561 .LVL42: 81:apps/loader/main.c **** } 562 .loc 1 81 2 view .LVU141 563 0040 FEFFFFEB bl wdog_reset 564 .LVL43: 82:apps/loader/main.c **** 565 .loc 1 82 1 is_stmt 0 view .LVU142 566 0044 F8FFFFEA b .L22 567 .L30: 568 .align 2 569 .L29: 570 0048 33000000 .word .LC1 571 004c 52000000 .word .LC2 572 .LBE59: 573 .LBE58: 574 .LBE57: 575 .LBE56: 576 .cfi_endproc 577 .LFE71: 579 .section .rodata.str1.1 580 .LC3: 581 006e 73657263 .ascii "sercomm_tx\000" 581 6F6D6D5F 581 747800 582 .LC4: 583 0079 4661696C .ascii "Failed to allocate reply buffer!\000" 583 65642074 583 6F20616C 583 6C6F6361 583 74652072 584 .LC5: 585 009a 756E6B6E .ascii "unknown command %d\012\000" 585 6F776E20 585 636F6D6D 585 616E6420 585 25640A00 586 .section .text.cmd_handler,"ax",%progbits 587 .align 2 588 .syntax unified 589 .arm 591 cmd_handler: 592 .LVL44: 593 .LFB70: 204:apps/loader/main.c **** if (msg->data_len < 1) { 594 .loc 1 204 1 is_stmt 1 view -0 595 .cfi_startproc 596 @ Function supports interworking. 597 @ args = 0, pretend = 0, frame = 8 598 @ frame_needed = 0, uses_anonymous_args = 0 205:apps/loader/main.c **** return; 599 .loc 1 205 2 view .LVU144 205:apps/loader/main.c **** return; 600 .loc 1 205 5 is_stmt 0 view .LVU145 601 0000 B433D1E1 ldrh r3, [r1, #52] 602 0004 000053E3 cmp r3, #0 603 0008 1EFF2F01 bxeq lr 204:apps/loader/main.c **** if (msg->data_len < 1) { 604 .loc 1 204 1 view .LVU146 605 000c F74F2DE9 push {r0, r1, r2, r4, r5, r6, r7, r8, r9, r10, fp, lr} 606 .LCFI15: 607 .cfi_def_cfa_offset 48 608 .cfi_offset 4, -36 609 .cfi_offset 5, -32 610 .cfi_offset 6, -28 611 .cfi_offset 7, -24 612 .cfi_offset 8, -20 613 .cfi_offset 9, -16 614 .cfi_offset 10, -12 615 .cfi_offset 11, -8 616 .cfi_offset 14, -4 617 0010 0060A0E1 mov r6, r0 618 .LBB91: 619 .LBB92: 209:apps/loader/main.c **** 620 .loc 1 209 20 view .LVU147 621 0014 0100A0E1 mov r0, r1 622 .LVL45: 209:apps/loader/main.c **** 623 .loc 1 209 20 view .LVU148 624 0018 FEFFFFEB bl msgb_pull_u8 625 .LVL46: 626 001c 0150A0E1 mov r5, r1 627 .LVL47: 209:apps/loader/main.c **** 628 .loc 1 209 20 view .LVU149 629 .LBE92: 630 .LBI91: 203:apps/loader/main.c **** { 631 .loc 1 203 13 is_stmt 1 view .LVU150 632 .LBB143: 209:apps/loader/main.c **** 633 .loc 1 209 2 view .LVU151 209:apps/loader/main.c **** 634 .loc 1 209 20 is_stmt 0 view .LVU152 635 0020 0080A0E1 mov r8, r0 636 .LVL48: 211:apps/loader/main.c **** 637 .loc 1 211 2 is_stmt 1 view .LVU153 213:apps/loader/main.c **** 638 .loc 1 213 2 view .LVU154 215:apps/loader/main.c **** 639 .loc 1 215 2 view .LVU155 217:apps/loader/main.c **** uint8_t nbytes; 640 .loc 1 217 2 view .LVU156 218:apps/loader/main.c **** uint16_t crc, mycrc; 641 .loc 1 218 2 view .LVU157 219:apps/loader/main.c **** uint32_t address; 642 .loc 1 219 2 view .LVU158 220:apps/loader/main.c **** 643 .loc 1 220 2 view .LVU159 222:apps/loader/main.c **** 644 .loc 1 222 2 view .LVU160 645 .LBB93: 646 .LBI93: 647 .file 3 "include/comm/sercomm.h" 1:include/comm/sercomm.h **** #ifndef _SERCOMM_H 2:include/comm/sercomm.h **** #define _SERCOMM_H 3:include/comm/sercomm.h **** 4:include/comm/sercomm.h **** #include 5:include/comm/sercomm.h **** 6:include/comm/sercomm.h **** #define HDLC_FLAG 0x7E 7:include/comm/sercomm.h **** #define HDLC_ESCAPE 0x7D 8:include/comm/sercomm.h **** 9:include/comm/sercomm.h **** #define HDLC_C_UI 0x03 10:include/comm/sercomm.h **** #define HDLC_C_P_BIT (1 << 4) 11:include/comm/sercomm.h **** #define HDLC_C_F_BIT (1 << 4) 12:include/comm/sercomm.h **** 13:include/comm/sercomm.h **** /* a low sercomm_dlci means high priority. A high DLCI means low priority */ 14:include/comm/sercomm.h **** enum sercomm_dlci { 15:include/comm/sercomm.h **** SC_DLCI_HIGHEST = 0, 16:include/comm/sercomm.h **** SC_DLCI_DEBUG = 4, 17:include/comm/sercomm.h **** SC_DLCI_L1A_L23 = 5, 18:include/comm/sercomm.h **** SC_DLCI_LOADER = 9, 19:include/comm/sercomm.h **** SC_DLCI_CONSOLE = 10, 20:include/comm/sercomm.h **** SC_DLCI_ECHO = 128, 21:include/comm/sercomm.h **** _SC_DLCI_MAX 22:include/comm/sercomm.h **** }; 23:include/comm/sercomm.h **** 24:include/comm/sercomm.h **** #ifndef HOST_BUILD 25:include/comm/sercomm.h **** /* helper functions for target */ 26:include/comm/sercomm.h **** void sercomm_bind_uart(int uart); 27:include/comm/sercomm.h **** int sercomm_get_uart(void); 28:include/comm/sercomm.h **** #endif 29:include/comm/sercomm.h **** 30:include/comm/sercomm.h **** void sercomm_init(void); 31:include/comm/sercomm.h **** int sercomm_initialized(void); 32:include/comm/sercomm.h **** 33:include/comm/sercomm.h **** /* User Interface: Tx */ 34:include/comm/sercomm.h **** 35:include/comm/sercomm.h **** /* user interface for transmitting messages for a given DLCI */ 36:include/comm/sercomm.h **** void sercomm_sendmsg(uint8_t dlci, struct msgb *msg); 37:include/comm/sercomm.h **** /* how deep is the Tx queue for a given DLCI */ 38:include/comm/sercomm.h **** unsigned int sercomm_tx_queue_depth(uint8_t dlci); 39:include/comm/sercomm.h **** 40:include/comm/sercomm.h **** /* User Interface: Rx */ 41:include/comm/sercomm.h **** 42:include/comm/sercomm.h **** /* receiving messages for a given DLCI */ 43:include/comm/sercomm.h **** typedef void (*dlci_cb_t)(uint8_t dlci, struct msgb *msg); 44:include/comm/sercomm.h **** int sercomm_register_rx_cb(uint8_t dlci, dlci_cb_t cb); 45:include/comm/sercomm.h **** 46:include/comm/sercomm.h **** /* Driver Interface */ 47:include/comm/sercomm.h **** 48:include/comm/sercomm.h **** /* fetch one octet of to-be-transmitted serial data. returns 0 if no more data */ 49:include/comm/sercomm.h **** int sercomm_drv_pull(uint8_t *ch); 50:include/comm/sercomm.h **** /* the driver has received one byte, pass it into sercomm layer. 51:include/comm/sercomm.h **** returns 1 in case of success, 0 in case of unrecognized char */ 52:include/comm/sercomm.h **** int sercomm_drv_rx_char(uint8_t ch); 53:include/comm/sercomm.h **** 54:include/comm/sercomm.h **** static inline struct msgb *sercomm_alloc_msgb(unsigned int len) 648 .loc 3 54 28 view .LVU161 55:include/comm/sercomm.h **** { 56:include/comm/sercomm.h **** return msgb_alloc_headroom(len+4, 4, "sercomm_tx"); 649 .loc 3 56 2 view .LVU162 650 .LBB94: 651 .LBI94: 325:../../shared/libosmocore/include/osmocom/core/msgb.h **** 326:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief Increase headroom of empty msgb, reducing the tailroom 327:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msg message buffer 328:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] len amount of extra octets to be reserved as headroom 329:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 330:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function reserves some memory at the beginning of the underlying 331:../../shared/libosmocore/include/osmocom/core/msgb.h **** * data buffer. The idea is to reserve space in case further headers 332:../../shared/libosmocore/include/osmocom/core/msgb.h **** * have to be pushed to the \ref msgb during further processing. 333:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 334:../../shared/libosmocore/include/osmocom/core/msgb.h **** * Calling this function leads to undefined reusults if it is called on 335:../../shared/libosmocore/include/osmocom/core/msgb.h **** * a non-empty \ref msgb. 336:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 337:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline void msgb_reserve(struct msgb *msg, int len) 338:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 339:../../shared/libosmocore/include/osmocom/core/msgb.h **** msg->data += len; 340:../../shared/libosmocore/include/osmocom/core/msgb.h **** msg->tail += len; 341:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 342:../../shared/libosmocore/include/osmocom/core/msgb.h **** 343:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief Trim the msgb to a given absolute length 344:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] msg message buffer 345:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] len new total length of buffer 346:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns 0 in case of success, negative in case of error 347:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 348:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline int msgb_trim(struct msgb *msg, int len) 349:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 350:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (len > msg->data_len) 351:../../shared/libosmocore/include/osmocom/core/msgb.h **** return -1; 352:../../shared/libosmocore/include/osmocom/core/msgb.h **** 353:../../shared/libosmocore/include/osmocom/core/msgb.h **** msg->len = len; 354:../../shared/libosmocore/include/osmocom/core/msgb.h **** msg->tail = msg->data + len; 355:../../shared/libosmocore/include/osmocom/core/msgb.h **** 356:../../shared/libosmocore/include/osmocom/core/msgb.h **** return 0; 357:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 358:../../shared/libosmocore/include/osmocom/core/msgb.h **** 359:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief Trim the msgb to a given layer3 length 360:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \pram[in] msg message buffer 361:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] l3len new layer3 length 362:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns 0 in case of success, negative in case of error 363:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 364:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline int msgb_l3trim(struct msgb *msg, int l3len) 365:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 366:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb_trim(msg, (msg->l3h - msg->data) + l3len); 367:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 368:../../shared/libosmocore/include/osmocom/core/msgb.h **** 369:../../shared/libosmocore/include/osmocom/core/msgb.h **** /*! \brief Allocate message buffer with specified headroom 370:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] size size in bytes, including headroom 371:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] headroom headroom in bytes 372:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \param[in] name human-readable name 373:../../shared/libosmocore/include/osmocom/core/msgb.h **** * \returns allocated message buffer with specified headroom 374:../../shared/libosmocore/include/osmocom/core/msgb.h **** * 375:../../shared/libosmocore/include/osmocom/core/msgb.h **** * This function is a convenience wrapper around \ref msgb_alloc 376:../../shared/libosmocore/include/osmocom/core/msgb.h **** * followed by \ref msgb_reserve in order to create a new \ref msgb with 377:../../shared/libosmocore/include/osmocom/core/msgb.h **** * user-specified amount of headroom. 378:../../shared/libosmocore/include/osmocom/core/msgb.h **** */ 379:../../shared/libosmocore/include/osmocom/core/msgb.h **** static inline struct msgb *msgb_alloc_headroom(int size, int headroom, 652 .loc 2 379 28 view .LVU163 653 .LBB95: 380:../../shared/libosmocore/include/osmocom/core/msgb.h **** const char *name) 381:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 382:../../shared/libosmocore/include/osmocom/core/msgb.h **** osmo_static_assert(size > headroom, headroom_bigger); 654 .loc 2 382 2 view .LVU164 655 .loc 2 382 54 view .LVU165 383:../../shared/libosmocore/include/osmocom/core/msgb.h **** 384:../../shared/libosmocore/include/osmocom/core/msgb.h **** struct msgb *msg = msgb_alloc(size, name); 656 .loc 2 384 2 view .LVU166 657 .loc 2 384 21 is_stmt 0 view .LVU167 658 0024 34159FE5 ldr r1, .L74 659 .LVL49: 660 .loc 2 384 21 view .LVU168 661 0028 410FA0E3 mov r0, #260 662 002c FEFFFFEB bl msgb_alloc 663 .LVL50: 385:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (msg) 664 .loc 2 385 2 is_stmt 1 view .LVU169 665 .loc 2 385 5 is_stmt 0 view .LVU170 666 0030 004050E2 subs r4, r0, #0 667 0034 0600001A bne .L33 386:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_reserve(msg, headroom); 387:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msg; 668 .loc 2 387 2 is_stmt 1 view .LVU171 669 .LVL51: 670 .loc 2 387 2 is_stmt 0 view .LVU172 671 .LBE95: 672 .LBE94: 673 .LBE93: 224:apps/loader/main.c **** printf("Failed to allocate reply buffer!\n"); 674 .loc 1 224 2 is_stmt 1 view .LVU173 225:apps/loader/main.c **** goto out; 675 .loc 1 225 3 view .LVU174 676 0038 24059FE5 ldr r0, .L74+4 677 003c FEFFFFEB bl puts 678 .LVL52: 226:apps/loader/main.c **** } 679 .loc 1 226 3 view .LVU175 680 .L34: 428:apps/loader/main.c **** } 681 .loc 1 428 2 view .LVU176 682 0040 0500A0E1 mov r0, r5 683 0044 FEFFFFEB bl msgb_free 684 .LVL53: 428:apps/loader/main.c **** } 685 .loc 1 428 2 is_stmt 0 view .LVU177 686 .LBE143: 687 .LBE91: 429:apps/loader/main.c **** 688 .loc 1 429 1 view .LVU178 689 0048 0CD08DE2 add sp, sp, #12 690 .LCFI16: 691 .cfi_remember_state 692 .cfi_def_cfa_offset 36 693 @ sp needed 694 004c F04FBDE8 pop {r4, r5, r6, r7, r8, r9, r10, fp, lr} 695 .LCFI17: 696 .cfi_restore 14 697 .cfi_restore 11 698 .cfi_restore 10 699 .cfi_restore 9 700 .cfi_restore 8 701 .cfi_restore 7 702 .cfi_restore 6 703 .cfi_restore 5 704 .cfi_restore 4 705 .cfi_def_cfa_offset 0 706 .LVL54: 429:apps/loader/main.c **** 707 .loc 1 429 1 view .LVU179 708 0050 1EFF2FE1 bx lr 709 .LVL55: 710 .L33: 711 .LCFI18: 712 .cfi_restore_state 713 .LBB145: 714 .LBB144: 715 .LBB100: 716 .LBB99: 717 .LBB98: 386:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msg; 718 .loc 2 386 3 is_stmt 1 view .LVU180 719 .LBB96: 720 .LBI96: 337:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 721 .loc 2 337 20 view .LVU181 722 .LBB97: 339:../../shared/libosmocore/include/osmocom/core/msgb.h **** msg->tail += len; 723 .loc 2 339 2 view .LVU182 339:../../shared/libosmocore/include/osmocom/core/msgb.h **** msg->tail += len; 724 .loc 2 339 12 is_stmt 0 view .LVU183 725 0054 403094E5 ldr r3, [r4, #64] 726 0058 043083E2 add r3, r3, #4 727 005c 403084E5 str r3, [r4, #64] 340:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 728 .loc 2 340 2 is_stmt 1 view .LVU184 340:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 729 .loc 2 340 12 is_stmt 0 view .LVU185 730 0060 3C3094E5 ldr r3, [r4, #60] 731 0064 043083E2 add r3, r3, #4 732 0068 3C3084E5 str r3, [r4, #60] 733 .LVL56: 340:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 734 .loc 2 340 12 view .LVU186 735 .LBE97: 736 .LBE96: 737 .loc 2 387 2 is_stmt 1 view .LVU187 738 .loc 2 387 2 is_stmt 0 view .LVU188 739 .LBE98: 740 .LBE99: 741 .LBE100: 224:apps/loader/main.c **** printf("Failed to allocate reply buffer!\n"); 742 .loc 1 224 2 is_stmt 1 view .LVU189 229:apps/loader/main.c **** 743 .loc 1 229 2 view .LVU190 744 006c 013048E2 sub r3, r8, #1 745 0070 0E0053E3 cmp r3, #14 746 0074 03F19F97 ldrls pc, [pc, r3, asl #2] 747 0078 320100EA b .L35 748 .L37: 749 007c B8000000 .word .L48 750 0080 CC000000 .word .L47 751 0084 E8000000 .word .L46 752 0088 94020000 .word .L45 753 008c 04010000 .word .L44 754 0090 30010000 .word .L43 755 0094 4C010000 .word .L42 756 0098 D0010000 .word .L41 757 009c D4020000 .word .L40 758 00a0 4C030000 .word .L39 759 00a4 4C030000 .word .L39 760 00a8 4C030000 .word .L39 761 00ac 4C030000 .word .L39 762 00b0 D4030000 .word .L38 763 00b4 44040000 .word .L36 764 .L48: 765 .LBB101: 232:apps/loader/main.c **** break; 766 .loc 1 232 3 view .LVU191 767 00b8 0120A0E3 mov r2, #1 768 00bc 0610A0E1 mov r1, r6 769 00c0 0400A0E1 mov r0, r4 770 .LVL57: 232:apps/loader/main.c **** break; 771 .loc 1 232 3 is_stmt 0 view .LVU192 772 00c4 FEFFFFEB bl loader_send_simple 773 .LVL58: 233:apps/loader/main.c **** 774 .loc 1 233 3 is_stmt 1 view .LVU193 775 00c8 DCFFFFEA b .L34 776 .LVL59: 777 .L47: 236:apps/loader/main.c **** device_reset(); 778 .loc 1 236 3 view .LVU194 779 00cc 0220A0E3 mov r2, #2 780 00d0 0610A0E1 mov r1, r6 781 00d4 0400A0E1 mov r0, r4 782 .LVL60: 236:apps/loader/main.c **** device_reset(); 783 .loc 1 236 3 is_stmt 0 view .LVU195 784 00d8 FEFFFFEB bl loader_send_simple 785 .LVL61: 237:apps/loader/main.c **** break; 786 .loc 1 237 3 is_stmt 1 view .LVU196 787 .LBB102: 788 .LBI102: 78:apps/loader/main.c **** { 789 .loc 1 78 13 view .LVU197 790 .LBB103: 80:apps/loader/main.c **** wdog_reset(); 791 .loc 1 80 2 view .LVU198 792 00dc FEFFFFEB bl flush_uart 793 .LVL62: 81:apps/loader/main.c **** } 794 .loc 1 81 2 view .LVU199 795 00e0 FEFFFFEB bl wdog_reset 796 .LVL63: 82:apps/loader/main.c **** 797 .loc 1 82 1 is_stmt 0 view .LVU200 798 00e4 D5FFFFEA b .L34 799 .LVL64: 800 .L46: 82:apps/loader/main.c **** 801 .loc 1 82 1 view .LVU201 802 .LBE103: 803 .LBE102: 241:apps/loader/main.c **** device_poweroff(); 804 .loc 1 241 3 is_stmt 1 view .LVU202 805 00e8 0320A0E3 mov r2, #3 806 00ec 0610A0E1 mov r1, r6 807 00f0 0400A0E1 mov r0, r4 808 .LVL65: 241:apps/loader/main.c **** device_poweroff(); 809 .loc 1 241 3 is_stmt 0 view .LVU203 810 00f4 FEFFFFEB bl loader_send_simple 811 .LVL66: 242:apps/loader/main.c **** break; 812 .loc 1 242 3 is_stmt 1 view .LVU204 813 .LBB104: 814 .LBI104: 72:apps/loader/main.c **** { 815 .loc 1 72 13 view .LVU205 816 .LBB105: 74:apps/loader/main.c **** twl3025_power_off(); 817 .loc 1 74 2 view .LVU206 818 00f8 FEFFFFEB bl flush_uart 819 .LVL67: 75:apps/loader/main.c **** } 820 .loc 1 75 2 view .LVU207 821 00fc FEFFFFEB bl twl3025_power_off 822 .LVL68: 76:apps/loader/main.c **** 823 .loc 1 76 1 is_stmt 0 view .LVU208 824 0100 CEFFFFEA b .L34 825 .LVL69: 826 .L44: 76:apps/loader/main.c **** 827 .loc 1 76 1 view .LVU209 828 .LBE105: 829 .LBE104: 246:apps/loader/main.c **** device_enter_loader(1); 830 .loc 1 246 3 is_stmt 1 view .LVU210 831 0104 0400A0E1 mov r0, r4 832 .LVL70: 246:apps/loader/main.c **** device_enter_loader(1); 833 .loc 1 246 3 is_stmt 0 view .LVU211 834 0108 0520A0E3 mov r2, #5 835 010c 0610A0E1 mov r1, r6 836 0110 FEFFFFEB bl loader_send_simple 837 .LVL71: 247:apps/loader/main.c **** break; 838 .loc 1 247 3 is_stmt 1 view .LVU212 839 .LBB106: 840 .LBI106: 84:apps/loader/main.c **** { 841 .loc 1 84 13 view .LVU213 842 .LBB107: 86:apps/loader/main.c **** 843 .loc 1 86 2 view .LVU214 844 0114 FEFFFFEB bl flush_uart 845 .LVL72: 88:apps/loader/main.c **** void (*entry) (void) = (void (*)(void))0; 846 .loc 1 88 2 view .LVU215 847 0118 0100A0E3 mov r0, #1 848 .LVL73: 849 .L71: 88:apps/loader/main.c **** void (*entry) (void) = (void (*)(void))0; 850 .loc 1 88 2 is_stmt 0 view .LVU216 851 .LBE107: 852 .LBE106: 853 .LBB108: 854 .LBB109: 855 011c FEFFFFEB bl calypso_bootrom 856 .LVL74: 89:apps/loader/main.c **** entry(); 857 .loc 1 89 2 is_stmt 1 view .LVU217 90:apps/loader/main.c **** } 858 .loc 1 90 2 view .LVU218 859 0120 0030A0E3 mov r3, #0 860 0124 0FE0A0E1 mov lr, pc 861 0128 13FF2FE1 bx r3 862 .LVL75: 91:apps/loader/main.c **** 863 .loc 1 91 1 is_stmt 0 view .LVU219 864 012c C3FFFFEA b .L34 865 .LVL76: 866 .L43: 91:apps/loader/main.c **** 867 .loc 1 91 1 view .LVU220 868 .LBE109: 869 .LBE108: 251:apps/loader/main.c **** device_enter_loader(0); 870 .loc 1 251 3 is_stmt 1 view .LVU221 871 0130 0400A0E1 mov r0, r4 872 .LVL77: 251:apps/loader/main.c **** device_enter_loader(0); 873 .loc 1 251 3 is_stmt 0 view .LVU222 874 0134 0620A0E3 mov r2, #6 875 0138 0610A0E1 mov r1, r6 876 013c FEFFFFEB bl loader_send_simple 877 .LVL78: 252:apps/loader/main.c **** break; 878 .loc 1 252 3 is_stmt 1 view .LVU223 879 .LBB111: 880 .LBI108: 84:apps/loader/main.c **** { 881 .loc 1 84 13 view .LVU224 882 .LBB110: 86:apps/loader/main.c **** 883 .loc 1 86 2 view .LVU225 884 0140 FEFFFFEB bl flush_uart 885 .LVL79: 88:apps/loader/main.c **** void (*entry) (void) = (void (*)(void))0; 886 .loc 1 88 2 view .LVU226 887 0144 0000A0E3 mov r0, #0 888 0148 F3FFFFEA b .L71 889 .LVL80: 890 .L42: 88:apps/loader/main.c **** void (*entry) (void) = (void (*)(void))0; 891 .loc 1 88 2 is_stmt 0 view .LVU227 892 .LBE110: 893 .LBE111: 257:apps/loader/main.c **** address = msgb_pull_u32(msg); 894 .loc 1 257 3 is_stmt 1 view .LVU228 257:apps/loader/main.c **** address = msgb_pull_u32(msg); 895 .loc 1 257 12 is_stmt 0 view .LVU229 896 014c 0500A0E1 mov r0, r5 897 .LVL81: 257:apps/loader/main.c **** address = msgb_pull_u32(msg); 898 .loc 1 257 12 view .LVU230 899 0150 FEFFFFEB bl msgb_pull_u8 900 .LVL82: 901 0154 0070A0E1 mov r7, r0 902 .LVL83: 258:apps/loader/main.c **** 903 .loc 1 258 3 is_stmt 1 view .LVU231 258:apps/loader/main.c **** 904 .loc 1 258 13 is_stmt 0 view .LVU232 905 0158 0500A0E1 mov r0, r5 906 015c FEFFFFEB bl msgb_pull_u32 907 .LVL84: 260:apps/loader/main.c **** 908 .loc 1 260 9 view .LVU233 909 0160 0720A0E1 mov r2, r7 258:apps/loader/main.c **** 910 .loc 1 258 13 view .LVU234 911 0164 0080A0E1 mov r8, r0 912 .LVL85: 260:apps/loader/main.c **** 913 .loc 1 260 3 is_stmt 1 view .LVU235 260:apps/loader/main.c **** 914 .loc 1 260 9 is_stmt 0 view .LVU236 915 0168 0010A0E1 mov r1, r0 916 016c 0000A0E3 mov r0, #0 917 .LVL86: 260:apps/loader/main.c **** 918 .loc 1 260 9 view .LVU237 919 0170 FEFFFFEB bl osmo_crc16 920 .LVL87: 260:apps/loader/main.c **** 921 .loc 1 260 9 view .LVU238 922 0174 0090A0E1 mov r9, r0 923 .LVL88: 262:apps/loader/main.c **** msgb_put_u8(reply, nbytes); 924 .loc 1 262 3 is_stmt 1 view .LVU239 925 0178 0710A0E3 mov r1, #7 926 017c 0400A0E1 mov r0, r4 927 0180 FEFFFFEB bl msgb_put_u8 928 .LVL89: 263:apps/loader/main.c **** msgb_put_u16(reply, crc); 929 .loc 1 263 3 view .LVU240 930 0184 0710A0E1 mov r1, r7 931 0188 0400A0E1 mov r0, r4 932 018c FEFFFFEB bl msgb_put_u8 933 .LVL90: 264:apps/loader/main.c **** msgb_put_u32(reply, address); 934 .loc 1 264 3 view .LVU241 935 0190 0910A0E1 mov r1, r9 936 0194 0400A0E1 mov r0, r4 937 0198 FEFFFFEB bl msgb_put_u16 938 .LVL91: 265:apps/loader/main.c **** 939 .loc 1 265 3 view .LVU242 940 019c 0810A0E1 mov r1, r8 941 01a0 0400A0E1 mov r0, r4 942 01a4 FEFFFFEB bl msgb_put_u32 943 .LVL92: 267:apps/loader/main.c **** 944 .loc 1 267 3 view .LVU243 267:apps/loader/main.c **** 945 .loc 1 267 10 is_stmt 0 view .LVU244 946 01a8 0710A0E1 mov r1, r7 947 01ac 0400A0E1 mov r0, r4 948 01b0 FEFFFFEB bl msgb_put 949 .LVL93: 267:apps/loader/main.c **** 950 .loc 1 267 3 view .LVU245 951 01b4 0720A0E1 mov r2, r7 952 01b8 0810A0E1 mov r1, r8 953 01bc FEFFFFEB bl memcpy 954 .LVL94: 269:apps/loader/main.c **** 955 .loc 1 269 3 is_stmt 1 view .LVU246 956 .L72: 414:apps/loader/main.c **** 957 .loc 1 414 3 view .LVU247 958 01c0 0410A0E1 mov r1, r4 959 01c4 0600A0E1 mov r0, r6 960 01c8 FEFFFFEB bl sercomm_sendmsg 961 .LVL95: 416:apps/loader/main.c **** 962 .loc 1 416 3 view .LVU248 963 01cc 9BFFFFEA b .L34 964 .LVL96: 965 .L41: 275:apps/loader/main.c **** crc = msgb_pull_u16(msg); 966 .loc 1 275 3 view .LVU249 275:apps/loader/main.c **** crc = msgb_pull_u16(msg); 967 .loc 1 275 12 is_stmt 0 view .LVU250 968 01d0 0500A0E1 mov r0, r5 969 .LVL97: 275:apps/loader/main.c **** crc = msgb_pull_u16(msg); 970 .loc 1 275 12 view .LVU251 971 01d4 FEFFFFEB bl msgb_pull_u8 972 .LVL98: 973 .LBB112: 974 .LBB113: 975 .LBB114: 976 .LBB115: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 977 .loc 2 294 12 view .LVU252 978 01d8 B633D5E1 ldrh r3, [r5, #54] 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 979 .loc 2 295 13 view .LVU253 980 01dc 402095E5 ldr r2, [r5, #64] 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 981 .loc 2 294 12 view .LVU254 982 01e0 023043E2 sub r3, r3, #2 983 01e4 B633C5E1 strh r3, [r5, #54] @ movhi 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 984 .loc 2 295 20 view .LVU255 985 01e8 023082E2 add r3, r2, #2 986 01ec 403085E5 str r3, [r5, #64] 987 01f0 0030D2E5 ldrb r3, [r2] @ zero_extendqisi2 988 01f4 0120D2E5 ldrb r2, [r2, #1] @ zero_extendqisi2 989 .LBE115: 990 .LBE114: 991 .LBE113: 992 .LBE112: 275:apps/loader/main.c **** crc = msgb_pull_u16(msg); 993 .loc 1 275 12 view .LVU256 994 01f8 0070A0E1 mov r7, r0 995 .LVL99: 276:apps/loader/main.c **** address = msgb_pull_u32(msg); 996 .loc 1 276 3 is_stmt 1 view .LVU257 997 .LBB119: 998 .LBI112: 311:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 999 .loc 2 311 24 view .LVU258 1000 .LBB118: 313:../../shared/libosmocore/include/osmocom/core/msgb.h **** return space[0] << 8 | space[1]; 1001 .loc 2 313 2 view .LVU259 1002 .LBB117: 1003 .LBI114: 292:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 1004 .loc 2 292 30 view .LVU260 1005 .LBB116: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1006 .loc 2 294 2 view .LVU261 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1007 .loc 2 295 2 view .LVU262 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1008 .loc 2 295 2 is_stmt 0 view .LVU263 1009 .LBE116: 1010 .LBE117: 314:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1011 .loc 2 314 2 is_stmt 1 view .LVU264 1012 01fc 023483E1 orr r3, r3, r2, lsl #8 1013 0200 2384A0E1 lsr r8, r3, #8 1014 .LVL100: 314:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1015 .loc 2 314 2 is_stmt 0 view .LVU265 1016 .LBE118: 1017 .LBE119: 277:apps/loader/main.c **** 1018 .loc 1 277 13 view .LVU266 1019 0204 0500A0E1 mov r0, r5 1020 0208 038488E1 orr r8, r8, r3, lsl #8 1021 020c FEFFFFEB bl msgb_pull_u32 1022 .LVL101: 1023 .LBB120: 1024 .LBB121: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1025 .loc 2 294 12 view .LVU267 1026 0210 B633D5E1 ldrh r3, [r5, #54] 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1027 .loc 2 295 13 view .LVU268 1028 0214 40B095E5 ldr fp, [r5, #64] 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1029 .loc 2 294 12 view .LVU269 1030 0218 073043E0 sub r3, r3, r7 1031 021c B633C5E1 strh r3, [r5, #54] @ movhi 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1032 .loc 2 295 20 view .LVU270 1033 0220 07308BE0 add r3, fp, r7 1034 .LBE121: 1035 .LBE120: 277:apps/loader/main.c **** 1036 .loc 1 277 13 view .LVU271 1037 0224 0090A0E1 mov r9, r0 281:apps/loader/main.c **** 1038 .loc 1 281 11 view .LVU272 1039 0228 0720A0E1 mov r2, r7 1040 022c 0B10A0E1 mov r1, fp 1041 0230 0000A0E3 mov r0, #0 1042 .LBB124: 1043 .LBB122: 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1044 .loc 2 295 20 view .LVU273 1045 0234 403085E5 str r3, [r5, #64] 1046 .LBE122: 1047 .LBE124: 281:apps/loader/main.c **** 1048 .loc 1 281 11 view .LVU274 1049 0238 FEFFFFEB bl osmo_crc16 1050 .LVL102: 1051 023c 0888A0E1 lsl r8, r8, #16 1052 0240 2888A0E1 lsr r8, r8, #16 1053 .LVL103: 277:apps/loader/main.c **** 1054 .loc 1 277 3 is_stmt 1 view .LVU275 279:apps/loader/main.c **** 1055 .loc 1 279 3 view .LVU276 1056 .LBB125: 1057 .LBI120: 292:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 1058 .loc 2 292 30 view .LVU277 1059 .LBB123: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1060 .loc 2 294 2 view .LVU278 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1061 .loc 2 295 2 view .LVU279 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1062 .loc 2 295 2 is_stmt 0 view .LVU280 1063 .LBE123: 1064 .LBE125: 281:apps/loader/main.c **** 1065 .loc 1 281 3 is_stmt 1 view .LVU281 283:apps/loader/main.c **** memcpy((void *)address, data, nbytes); 1066 .loc 1 283 6 is_stmt 0 view .LVU282 1067 0244 080050E1 cmp r0, r8 281:apps/loader/main.c **** 1068 .loc 1 281 11 view .LVU283 1069 0248 00A0A0E1 mov r10, r0 1070 .LVL104: 283:apps/loader/main.c **** memcpy((void *)address, data, nbytes); 1071 .loc 1 283 3 is_stmt 1 view .LVU284 283:apps/loader/main.c **** memcpy((void *)address, data, nbytes); 1072 .loc 1 283 6 is_stmt 0 view .LVU285 1073 024c 0300001A bne .L49 284:apps/loader/main.c **** } 1074 .loc 1 284 4 is_stmt 1 view .LVU286 1075 0250 0720A0E1 mov r2, r7 1076 0254 0B10A0E1 mov r1, fp 1077 0258 0900A0E1 mov r0, r9 1078 .LVL105: 284:apps/loader/main.c **** } 1079 .loc 1 284 4 is_stmt 0 view .LVU287 1080 025c FEFFFFEB bl memcpy 1081 .LVL106: 1082 .L49: 287:apps/loader/main.c **** msgb_put_u8(reply, nbytes); 1083 .loc 1 287 3 is_stmt 1 view .LVU288 1084 0260 0810A0E3 mov r1, #8 1085 0264 0400A0E1 mov r0, r4 1086 0268 FEFFFFEB bl msgb_put_u8 1087 .LVL107: 288:apps/loader/main.c **** msgb_put_u16(reply, mycrc); 1088 .loc 1 288 3 view .LVU289 1089 026c 0710A0E1 mov r1, r7 1090 0270 0400A0E1 mov r0, r4 1091 0274 FEFFFFEB bl msgb_put_u8 1092 .LVL108: 289:apps/loader/main.c **** msgb_put_u32(reply, address); 1093 .loc 1 289 3 view .LVU290 1094 0278 0A10A0E1 mov r1, r10 1095 027c 0400A0E1 mov r0, r4 1096 0280 FEFFFFEB bl msgb_put_u16 1097 .LVL109: 290:apps/loader/main.c **** 1098 .loc 1 290 3 view .LVU291 1099 0284 0910A0E1 mov r1, r9 1100 .LVL110: 1101 .L73: 412:apps/loader/main.c **** 1102 .loc 1 412 3 is_stmt 0 view .LVU292 1103 0288 0400A0E1 mov r0, r4 1104 028c FEFFFFEB bl msgb_put_u32 1105 .LVL111: 1106 0290 CAFFFFEA b .L72 1107 .LVL112: 1108 .L45: 298:apps/loader/main.c **** 1109 .loc 1 298 3 is_stmt 1 view .LVU293 298:apps/loader/main.c **** 1110 .loc 1 298 13 is_stmt 0 view .LVU294 1111 0294 0500A0E1 mov r0, r5 1112 .LVL113: 298:apps/loader/main.c **** 1113 .loc 1 298 13 view .LVU295 1114 0298 FEFFFFEB bl msgb_pull_u32 1115 .LVL114: 1116 029c 0070A0E1 mov r7, r0 1117 .LVL115: 300:apps/loader/main.c **** msgb_put_u32(reply, address); 1118 .loc 1 300 3 is_stmt 1 view .LVU296 1119 02a0 0410A0E3 mov r1, #4 1120 02a4 0400A0E1 mov r0, r4 1121 .LVL116: 300:apps/loader/main.c **** msgb_put_u32(reply, address); 1122 .loc 1 300 3 is_stmt 0 view .LVU297 1123 02a8 FEFFFFEB bl msgb_put_u8 1124 .LVL117: 301:apps/loader/main.c **** 1125 .loc 1 301 3 is_stmt 1 view .LVU298 1126 02ac 0710A0E1 mov r1, r7 1127 02b0 0400A0E1 mov r0, r4 1128 02b4 FEFFFFEB bl msgb_put_u32 1129 .LVL118: 303:apps/loader/main.c **** 1130 .loc 1 303 3 view .LVU299 1131 02b8 0410A0E1 mov r1, r4 1132 02bc 0600A0E1 mov r0, r6 1133 02c0 FEFFFFEB bl sercomm_sendmsg 1134 .LVL119: 305:apps/loader/main.c **** 1135 .loc 1 305 3 view .LVU300 1136 .LBB126: 1137 .LBI126: 93:apps/loader/main.c **** { 1138 .loc 1 93 13 view .LVU301 1139 .LBB127: 95:apps/loader/main.c **** 1140 .loc 1 95 2 view .LVU302 1141 02c4 FEFFFFEB bl flush_uart 1142 .LVL120: 97:apps/loader/main.c **** f(); 1143 .loc 1 97 2 view .LVU303 98:apps/loader/main.c **** } 1144 .loc 1 98 2 view .LVU304 1145 02c8 0FE0A0E1 mov lr, pc 1146 02cc 17FF2FE1 bx r7 1147 .LVL121: 99:apps/loader/main.c **** 1148 .loc 1 99 1 is_stmt 0 view .LVU305 1149 02d0 5AFFFFEA b .L34 1150 .LVL122: 1151 .L40: 99:apps/loader/main.c **** 1152 .loc 1 99 1 view .LVU306 1153 .LBE127: 1154 .LBE126: 311:apps/loader/main.c **** msgb_put_u8(reply, 1); // nchips 1155 .loc 1 311 3 is_stmt 1 view .LVU307 315:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_size); 1156 .loc 1 315 42 is_stmt 0 view .LVU308 1157 02d4 8C729FE5 ldr r7, .L74+8 311:apps/loader/main.c **** msgb_put_u8(reply, 1); // nchips 1158 .loc 1 311 3 view .LVU309 1159 02d8 0910A0E3 mov r1, #9 1160 02dc 0400A0E1 mov r0, r4 1161 .LVL123: 311:apps/loader/main.c **** msgb_put_u8(reply, 1); // nchips 1162 .loc 1 311 3 view .LVU310 1163 02e0 FEFFFFEB bl msgb_put_u8 1164 .LVL124: 312:apps/loader/main.c **** 1165 .loc 1 312 3 is_stmt 1 view .LVU311 1166 02e4 0110A0E3 mov r1, #1 1167 02e8 0400A0E1 mov r0, r4 1168 02ec FEFFFFEB bl msgb_put_u8 1169 .LVL125: 315:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_size); 1170 .loc 1 315 3 view .LVU312 1171 02f0 0400A0E1 mov r0, r4 1172 02f4 041097E5 ldr r1, [r7, #4] 1173 02f8 FEFFFFEB bl msgb_put_u32 1174 .LVL126: 316:apps/loader/main.c **** msgb_put_u8(reply, the_flash.f_nregions); 1175 .loc 1 316 3 view .LVU313 1176 02fc 0400A0E1 mov r0, r4 1177 0300 081097E5 ldr r1, [r7, #8] 1178 0304 FEFFFFEB bl msgb_put_u32 1179 .LVL127: 317:apps/loader/main.c **** 1180 .loc 1 317 3 view .LVU314 1181 0308 0400A0E1 mov r0, r4 1182 030c 0C10D7E5 ldrb r1, [r7, #12] @ zero_extendqisi2 1183 0310 FEFFFFEB bl msgb_put_u8 1184 .LVL128: 319:apps/loader/main.c **** for (i = 0; i < the_flash.f_nregions; i++) { 1185 .loc 1 319 3 view .LVU315 320:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_regions[i].fr_bnum); 1186 .loc 1 320 3 view .LVU316 320:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_regions[i].fr_bnum); 1187 .loc 1 320 10 is_stmt 0 view .LVU317 1188 0314 0090A0E3 mov r9, #0 1189 0318 048087E2 add r8, r7, #4 1190 .LVL129: 1191 .L50: 320:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_regions[i].fr_bnum); 1192 .loc 1 320 17 is_stmt 1 view .LVU318 1193 031c 0C3097E5 ldr r3, [r7, #12] 1194 0320 030059E1 cmp r9, r3 1195 0324 0C8088E2 add r8, r8, #12 1196 0328 A4FFFF2A bcs .L72 321:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_regions[i].fr_bsize); 1197 .loc 1 321 4 view .LVU319 1198 032c 0400A0E1 mov r0, r4 1199 0330 041098E5 ldr r1, [r8, #4] 1200 0334 FEFFFFEB bl msgb_put_u32 1201 .LVL130: 322:apps/loader/main.c **** } 1202 .loc 1 322 4 view .LVU320 1203 0338 0400A0E1 mov r0, r4 1204 033c 081098E5 ldr r1, [r8, #8] 1205 0340 FEFFFFEB bl msgb_put_u32 1206 .LVL131: 320:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_regions[i].fr_bnum); 1207 .loc 1 320 42 view .LVU321 1208 0344 019089E2 add r9, r9, #1 1209 .LVL132: 320:apps/loader/main.c **** msgb_put_u32(reply, the_flash.f_regions[i].fr_bnum); 1210 .loc 1 320 42 is_stmt 0 view .LVU322 1211 0348 F3FFFFEA b .L50 1212 .LVL133: 1213 .L39: 334:apps/loader/main.c **** address = msgb_pull_u32(msg); 1214 .loc 1 334 3 is_stmt 1 view .LVU323 334:apps/loader/main.c **** address = msgb_pull_u32(msg); 1215 .loc 1 334 10 is_stmt 0 view .LVU324 1216 034c 0500A0E1 mov r0, r5 1217 .LVL134: 334:apps/loader/main.c **** address = msgb_pull_u32(msg); 1218 .loc 1 334 10 view .LVU325 1219 0350 FEFFFFEB bl msgb_pull_u8 1220 .LVL135: 1221 0354 00A0A0E1 mov r10, r0 1222 .LVL136: 335:apps/loader/main.c **** 1223 .loc 1 335 3 is_stmt 1 view .LVU326 335:apps/loader/main.c **** 1224 .loc 1 335 13 is_stmt 0 view .LVU327 1225 0358 0500A0E1 mov r0, r5 1226 035c FEFFFFEB bl msgb_pull_u32 1227 .LVL137: 337:apps/loader/main.c **** res = flash_block_erase(&the_flash, address); 1228 .loc 1 337 6 view .LVU328 1229 0360 0A0058E3 cmp r8, #10 335:apps/loader/main.c **** 1230 .loc 1 335 13 view .LVU329 1231 0364 0090A0E1 mov r9, r0 1232 .LVL138: 337:apps/loader/main.c **** res = flash_block_erase(&the_flash, address); 1233 .loc 1 337 3 is_stmt 1 view .LVU330 338:apps/loader/main.c **** } 1234 .loc 1 338 10 is_stmt 0 view .LVU331 1235 0368 0010A0E1 mov r1, r0 1236 036c F8019FE5 ldr r0, .L74+12 1237 .LVL139: 337:apps/loader/main.c **** res = flash_block_erase(&the_flash, address); 1238 .loc 1 337 6 view .LVU332 1239 0370 1100000A beq .L52 340:apps/loader/main.c **** res = flash_block_unlock(&the_flash, address); 1240 .loc 1 340 3 is_stmt 1 view .LVU333 340:apps/loader/main.c **** res = flash_block_unlock(&the_flash, address); 1241 .loc 1 340 6 is_stmt 0 view .LVU334 1242 0374 0B0058E3 cmp r8, #11 1243 0378 1100000A beq .L53 343:apps/loader/main.c **** res = flash_block_lock(&the_flash, address); 1244 .loc 1 343 3 is_stmt 1 view .LVU335 343:apps/loader/main.c **** res = flash_block_lock(&the_flash, address); 1245 .loc 1 343 6 is_stmt 0 view .LVU336 1246 037c 0C0058E3 cmp r8, #12 1247 0380 1100000A beq .L54 346:apps/loader/main.c **** res = flash_block_lockdown(&the_flash, address); 1248 .loc 1 346 3 is_stmt 1 view .LVU337 347:apps/loader/main.c **** } 1249 .loc 1 347 4 view .LVU338 347:apps/loader/main.c **** } 1250 .loc 1 347 10 is_stmt 0 view .LVU339 1251 0384 FEFFFFEB bl flash_block_lockdown 1252 .LVL140: 1253 .L69: 344:apps/loader/main.c **** } 1254 .loc 1 344 10 view .LVU340 1255 0388 0070A0E1 mov r7, r0 1256 .LVL141: 346:apps/loader/main.c **** res = flash_block_lockdown(&the_flash, address); 1257 .loc 1 346 3 is_stmt 1 view .LVU341 350:apps/loader/main.c **** msgb_put_u8(reply, chip); 1258 .loc 1 350 3 view .LVU342 1259 038c 0810A0E1 mov r1, r8 1260 0390 0400A0E1 mov r0, r4 1261 .LVL142: 350:apps/loader/main.c **** msgb_put_u8(reply, chip); 1262 .loc 1 350 3 is_stmt 0 view .LVU343 1263 0394 FEFFFFEB bl msgb_put_u8 1264 .LVL143: 351:apps/loader/main.c **** msgb_put_u32(reply, address); 1265 .loc 1 351 3 is_stmt 1 view .LVU344 1266 0398 0A10A0E1 mov r1, r10 1267 039c 0400A0E1 mov r0, r4 1268 03a0 FEFFFFEB bl msgb_put_u8 1269 .LVL144: 352:apps/loader/main.c **** msgb_put_u32(reply, (res != 0)); 1270 .loc 1 352 3 view .LVU345 1271 03a4 0910A0E1 mov r1, r9 1272 03a8 0400A0E1 mov r0, r4 1273 03ac FEFFFFEB bl msgb_put_u32 1274 .LVL145: 353:apps/loader/main.c **** 1275 .loc 1 353 3 view .LVU346 1276 03b0 001057E2 subs r1, r7, #0 1277 03b4 0110A013 movne r1, #1 1278 03b8 B2FFFFEA b .L73 1279 .LVL146: 1280 .L52: 338:apps/loader/main.c **** } 1281 .loc 1 338 4 view .LVU347 338:apps/loader/main.c **** } 1282 .loc 1 338 10 is_stmt 0 view .LVU348 1283 03bc FEFFFFEB bl flash_block_erase 1284 .LVL147: 338:apps/loader/main.c **** } 1285 .loc 1 338 10 view .LVU349 1286 03c0 F0FFFFEA b .L69 1287 .LVL148: 1288 .L53: 341:apps/loader/main.c **** } 1289 .loc 1 341 4 is_stmt 1 view .LVU350 341:apps/loader/main.c **** } 1290 .loc 1 341 10 is_stmt 0 view .LVU351 1291 03c4 FEFFFFEB bl flash_block_unlock 1292 .LVL149: 341:apps/loader/main.c **** } 1293 .loc 1 341 10 view .LVU352 1294 03c8 EEFFFFEA b .L69 1295 .LVL150: 1296 .L54: 344:apps/loader/main.c **** } 1297 .loc 1 344 4 is_stmt 1 view .LVU353 344:apps/loader/main.c **** } 1298 .loc 1 344 10 is_stmt 0 view .LVU354 1299 03cc FEFFFFEB bl flash_block_lock 1300 .LVL151: 344:apps/loader/main.c **** } 1301 .loc 1 344 10 view .LVU355 1302 03d0 ECFFFFEA b .L69 1303 .LVL152: 1304 .L38: 361:apps/loader/main.c **** address = msgb_pull_u32(msg); 1305 .loc 1 361 3 is_stmt 1 view .LVU356 361:apps/loader/main.c **** address = msgb_pull_u32(msg); 1306 .loc 1 361 10 is_stmt 0 view .LVU357 1307 03d4 0500A0E1 mov r0, r5 1308 .LVL153: 361:apps/loader/main.c **** address = msgb_pull_u32(msg); 1309 .loc 1 361 10 view .LVU358 1310 03d8 FEFFFFEB bl msgb_pull_u8 1311 .LVL154: 1312 03dc 0090A0E1 mov r9, r0 1313 .LVL155: 362:apps/loader/main.c **** 1314 .loc 1 362 3 is_stmt 1 view .LVU359 362:apps/loader/main.c **** 1315 .loc 1 362 13 is_stmt 0 view .LVU360 1316 03e0 0500A0E1 mov r0, r5 1317 03e4 FEFFFFEB bl msgb_pull_u32 1318 .LVL156: 364:apps/loader/main.c **** 1319 .loc 1 364 10 view .LVU361 1320 03e8 0010A0E1 mov r1, r0 362:apps/loader/main.c **** 1321 .loc 1 362 13 view .LVU362 1322 03ec 0080A0E1 mov r8, r0 1323 .LVL157: 364:apps/loader/main.c **** 1324 .loc 1 364 3 is_stmt 1 view .LVU363 364:apps/loader/main.c **** 1325 .loc 1 364 10 is_stmt 0 view .LVU364 1326 03f0 74019FE5 ldr r0, .L74+12 1327 .LVL158: 364:apps/loader/main.c **** 1328 .loc 1 364 10 view .LVU365 1329 03f4 FEFFFFEB bl flash_block_getlock 1330 .LVL159: 364:apps/loader/main.c **** 1331 .loc 1 364 10 view .LVU366 1332 03f8 0070A0E1 mov r7, r0 1333 .LVL160: 366:apps/loader/main.c **** msgb_put_u8(reply, chip); 1334 .loc 1 366 3 is_stmt 1 view .LVU367 1335 03fc 0E10A0E3 mov r1, #14 1336 0400 0400A0E1 mov r0, r4 1337 0404 FEFFFFEB bl msgb_put_u8 1338 .LVL161: 367:apps/loader/main.c **** msgb_put_u32(reply, address); 1339 .loc 1 367 3 view .LVU368 1340 0408 0910A0E1 mov r1, r9 1341 040c 0400A0E1 mov r0, r4 1342 0410 FEFFFFEB bl msgb_put_u8 1343 .LVL162: 368:apps/loader/main.c **** 1344 .loc 1 368 3 view .LVU369 1345 0414 0810A0E1 mov r1, r8 1346 0418 0400A0E1 mov r0, r4 1347 041c FEFFFFEB bl msgb_put_u32 1348 .LVL163: 370:apps/loader/main.c **** case FLASH_UNLOCKED: 1349 .loc 1 370 3 view .LVU370 1350 0420 010057E3 cmp r7, #1 1351 0424 0400000A beq .L57 1352 0428 020057E3 cmp r7, #2 1353 042c 0200000A beq .L57 1354 0430 000057E3 cmp r7, #0 381:apps/loader/main.c **** break; 1355 .loc 1 381 4 is_stmt 0 view .LVU371 1356 0434 0010E013 mvnne r1, #0 1357 0438 92FFFF1A bne .L73 1358 .L57: 378:apps/loader/main.c **** break; 1359 .loc 1 378 4 is_stmt 1 view .LVU372 1360 043c 0710A0E1 mov r1, r7 1361 0440 90FFFFEA b .L73 1362 .LVL164: 1363 .L36: 391:apps/loader/main.c **** crc = msgb_pull_u16(msg); 1364 .loc 1 391 3 view .LVU373 391:apps/loader/main.c **** crc = msgb_pull_u16(msg); 1365 .loc 1 391 12 is_stmt 0 view .LVU374 1366 0444 0500A0E1 mov r0, r5 1367 .LVL165: 391:apps/loader/main.c **** crc = msgb_pull_u16(msg); 1368 .loc 1 391 12 view .LVU375 1369 0448 FEFFFFEB bl msgb_pull_u8 1370 .LVL166: 1371 .LBB128: 1372 .LBB129: 1373 .LBB130: 1374 .LBB131: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1375 .loc 2 294 12 view .LVU376 1376 044c B633D5E1 ldrh r3, [r5, #54] 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1377 .loc 2 295 13 view .LVU377 1378 0450 402095E5 ldr r2, [r5, #64] 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1379 .loc 2 294 12 view .LVU378 1380 0454 023043E2 sub r3, r3, #2 1381 0458 B633C5E1 strh r3, [r5, #54] @ movhi 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1382 .loc 2 295 20 view .LVU379 1383 045c 023082E2 add r3, r2, #2 1384 0460 403085E5 str r3, [r5, #64] 1385 0464 0030D2E5 ldrb r3, [r2] @ zero_extendqisi2 1386 0468 0120D2E5 ldrb r2, [r2, #1] @ zero_extendqisi2 1387 046c 023483E1 orr r3, r3, r2, lsl #8 1388 0470 2384A0E1 lsr r8, r3, #8 1389 .LVL167: 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1390 .loc 2 295 20 view .LVU380 1391 .LBE131: 1392 .LBE130: 1393 .LBE129: 1394 .LBE128: 391:apps/loader/main.c **** crc = msgb_pull_u16(msg); 1395 .loc 1 391 12 view .LVU381 1396 0474 0070A0E1 mov r7, r0 1397 .LVL168: 392:apps/loader/main.c **** msgb_pull_u8(msg); // XXX align 1398 .loc 1 392 3 is_stmt 1 view .LVU382 1399 .LBB135: 1400 .LBI128: 311:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 1401 .loc 2 311 24 view .LVU383 1402 .LBB134: 313:../../shared/libosmocore/include/osmocom/core/msgb.h **** return space[0] << 8 | space[1]; 1403 .loc 2 313 2 view .LVU384 1404 .LBB133: 1405 .LBI130: 292:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 1406 .loc 2 292 30 view .LVU385 1407 .LBB132: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1408 .loc 2 294 2 view .LVU386 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1409 .loc 2 295 2 view .LVU387 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1410 .loc 2 295 2 is_stmt 0 view .LVU388 1411 .LBE132: 1412 .LBE133: 314:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1413 .loc 2 314 2 is_stmt 1 view .LVU389 1414 .LBE134: 1415 .LBE135: 393:apps/loader/main.c **** chip = msgb_pull_u8(msg); 1416 .loc 1 393 3 is_stmt 0 view .LVU390 1417 0478 0500A0E1 mov r0, r5 1418 047c 038488E1 orr r8, r8, r3, lsl #8 1419 0480 FEFFFFEB bl msgb_pull_u8 1420 .LVL169: 394:apps/loader/main.c **** address = msgb_pull_u32(msg); 1421 .loc 1 394 10 view .LVU391 1422 0484 0500A0E1 mov r0, r5 1423 0488 FEFFFFEB bl msgb_pull_u8 1424 .LVL170: 1425 048c 00B0A0E1 mov fp, r0 395:apps/loader/main.c **** 1426 .loc 1 395 13 view .LVU392 1427 0490 0500A0E1 mov r0, r5 1428 0494 FEFFFFEB bl msgb_pull_u32 1429 .LVL171: 1430 .LBB136: 1431 .LBB137: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1432 .loc 2 294 12 view .LVU393 1433 0498 B633D5E1 ldrh r3, [r5, #54] 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1434 .loc 2 295 13 view .LVU394 1435 049c 401095E5 ldr r1, [r5, #64] 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1436 .loc 2 294 12 view .LVU395 1437 04a0 073043E0 sub r3, r3, r7 1438 04a4 B633C5E1 strh r3, [r5, #54] @ movhi 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1439 .loc 2 295 20 view .LVU396 1440 04a8 073081E0 add r3, r1, r7 1441 .LBE137: 1442 .LBE136: 395:apps/loader/main.c **** 1443 .loc 1 395 13 view .LVU397 1444 04ac 0090A0E1 mov r9, r0 399:apps/loader/main.c **** 1445 .loc 1 399 11 view .LVU398 1446 04b0 0720A0E1 mov r2, r7 1447 04b4 0000A0E3 mov r0, #0 1448 .LBB140: 1449 .LBB138: 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1450 .loc 2 295 20 view .LVU399 1451 04b8 403085E5 str r3, [r5, #64] 1452 .LBE138: 1453 .LBE140: 399:apps/loader/main.c **** 1454 .loc 1 399 11 view .LVU400 1455 04bc 04108DE5 str r1, [sp, #4] 1456 04c0 FEFFFFEB bl osmo_crc16 1457 .LVL172: 1458 04c4 0888A0E1 lsl r8, r8, #16 1459 04c8 2888A0E1 lsr r8, r8, #16 1460 .LVL173: 393:apps/loader/main.c **** chip = msgb_pull_u8(msg); 1461 .loc 1 393 3 is_stmt 1 view .LVU401 394:apps/loader/main.c **** address = msgb_pull_u32(msg); 1462 .loc 1 394 3 view .LVU402 395:apps/loader/main.c **** 1463 .loc 1 395 3 view .LVU403 397:apps/loader/main.c **** 1464 .loc 1 397 3 view .LVU404 1465 .LBB141: 1466 .LBI136: 292:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 1467 .loc 2 292 30 view .LVU405 1468 .LBB139: 294:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msgb->data += len; 1469 .loc 2 294 2 view .LVU406 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1470 .loc 2 295 2 view .LVU407 295:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 1471 .loc 2 295 2 is_stmt 0 view .LVU408 1472 .LBE139: 1473 .LBE141: 399:apps/loader/main.c **** 1474 .loc 1 399 3 is_stmt 1 view .LVU409 401:apps/loader/main.c **** res = flash_program(&the_flash, address, data, nbytes); 1475 .loc 1 401 6 is_stmt 0 view .LVU410 1476 04cc 080050E1 cmp r0, r8 399:apps/loader/main.c **** 1477 .loc 1 399 11 view .LVU411 1478 04d0 00A0A0E1 mov r10, r0 1479 .LVL174: 401:apps/loader/main.c **** res = flash_program(&the_flash, address, data, nbytes); 1480 .loc 1 401 3 is_stmt 1 view .LVU412 1481 .LBE101: 211:apps/loader/main.c **** 1482 .loc 1 211 6 is_stmt 0 view .LVU413 1483 04d4 0080A013 movne r8, #0 1484 .LVL175: 1485 .LBB142: 401:apps/loader/main.c **** res = flash_program(&the_flash, address, data, nbytes); 1486 .loc 1 401 6 view .LVU414 1487 04d8 04109DE5 ldr r1, [sp, #4] 1488 04dc 0500001A bne .L60 402:apps/loader/main.c **** } 1489 .loc 1 402 4 is_stmt 1 view .LVU415 402:apps/loader/main.c **** } 1490 .loc 1 402 10 is_stmt 0 view .LVU416 1491 04e0 0120A0E1 mov r2, r1 1492 04e4 0730A0E1 mov r3, r7 1493 04e8 0910A0E1 mov r1, r9 1494 04ec 78009FE5 ldr r0, .L74+12 1495 .LVL176: 402:apps/loader/main.c **** } 1496 .loc 1 402 10 view .LVU417 1497 04f0 FEFFFFEB bl flash_program 1498 .LVL177: 1499 04f4 0080A0E1 mov r8, r0 1500 .LVL178: 1501 .L60: 405:apps/loader/main.c **** msgb_put_u8(reply, nbytes); 1502 .loc 1 405 3 is_stmt 1 view .LVU418 1503 04f8 0F10A0E3 mov r1, #15 1504 04fc 0400A0E1 mov r0, r4 1505 0500 FEFFFFEB bl msgb_put_u8 1506 .LVL179: 406:apps/loader/main.c **** msgb_put_u16(reply, mycrc); 1507 .loc 1 406 3 view .LVU419 1508 0504 0710A0E1 mov r1, r7 1509 0508 0400A0E1 mov r0, r4 1510 050c FEFFFFEB bl msgb_put_u8 1511 .LVL180: 407:apps/loader/main.c **** msgb_put_u8(reply, 0); // XXX align 1512 .loc 1 407 3 view .LVU420 1513 0510 0A10A0E1 mov r1, r10 1514 0514 0400A0E1 mov r0, r4 1515 0518 FEFFFFEB bl msgb_put_u16 1516 .LVL181: 408:apps/loader/main.c **** msgb_put_u8(reply, chip); 1517 .loc 1 408 3 view .LVU421 1518 051c 0010A0E3 mov r1, #0 1519 0520 0400A0E1 mov r0, r4 1520 0524 FEFFFFEB bl msgb_put_u8 1521 .LVL182: 409:apps/loader/main.c **** msgb_put_u32(reply, address); 1522 .loc 1 409 3 view .LVU422 1523 0528 0B10A0E1 mov r1, fp 1524 052c 0400A0E1 mov r0, r4 1525 0530 FEFFFFEB bl msgb_put_u8 1526 .LVL183: 410:apps/loader/main.c **** 1527 .loc 1 410 3 view .LVU423 1528 0534 0910A0E1 mov r1, r9 1529 0538 0400A0E1 mov r0, r4 1530 053c FEFFFFEB bl msgb_put_u32 1531 .LVL184: 412:apps/loader/main.c **** 1532 .loc 1 412 3 view .LVU424 1533 0540 0810A0E1 mov r1, r8 1534 0544 4FFFFFEA b .L73 1535 .LVL185: 1536 .L35: 419:apps/loader/main.c **** 1537 .loc 1 419 3 view .LVU425 1538 0548 0810A0E1 mov r1, r8 1539 054c 1C009FE5 ldr r0, .L74+16 1540 .LVL186: 419:apps/loader/main.c **** 1541 .loc 1 419 3 is_stmt 0 view .LVU426 1542 0550 FEFFFFEB bl printf 1543 .LVL187: 421:apps/loader/main.c **** 1544 .loc 1 421 3 is_stmt 1 view .LVU427 1545 0554 0400A0E1 mov r0, r4 1546 0558 FEFFFFEB bl msgb_free 1547 .LVL188: 423:apps/loader/main.c **** } 1548 .loc 1 423 3 view .LVU428 1549 055c B7FEFFEA b .L34 1550 .L75: 1551 .align 2 1552 .L74: 1553 0560 6E000000 .word .LC3 1554 0564 79000000 .word .LC4 1555 0568 00000000 .word .LANCHOR0 1556 056c 04000000 .word .LANCHOR0+4 1557 0570 9A000000 .word .LC5 1558 .LBE142: 1559 .LBE144: 1560 .LBE145: 1561 .cfi_endproc 1562 .LFE70: 1564 .section .rodata.str1.1 1565 .LC6: 1566 00ae 0A0A4F73 .ascii "\012\012OsmocomBB Loader (revision osmocon_v0.0.0-3" 1566 6D6F636F 1566 6D424220 1566 4C6F6164 1566 65722028 1567 00db 3330362D .ascii "306-g04ea6f9c)\012\000" 1567 67303465 1567 61366639 1567 63290A00 1568 .LC7: 1569 00eb 6C6F6164 .ascii "loader\000" 1569 657200 1570 .LC8: 1571 00f2 6F736D6F .ascii "osmocom-bb\000" 1571 636F6D2D 1571 626200 1572 .LC9: 1573 00fd 52756E6E .ascii "Running on %s in environment %s\012\000" 1573 696E6720 1573 6F6E2025 1573 7320696E 1573 20656E76 1574 .LC10: 1575 011e 4661696C .ascii "Failed to initialize flash!\012\000" 1575 65642074 1575 6F20696E 1575 69746961 1575 6C697A65 1576 .LC11: 1577 013b 466F756E .ascii "Found flash of %zu bytes at 0x%p with %zu regions\012" 1577 6420666C 1577 61736820 1577 6F662025 1577 7A752062 1578 016d 00 .ascii "\000" 1579 .LC12: 1580 016e 20205265 .ascii " Region %d of %zu pages with %zu bytes each.\012\000" 1580 67696F6E 1580 20256420 1580 6F662025 1580 7A752070 1581 .section .text.startup.main,"ax",%progbits 1582 .align 2 1583 .global main 1584 .syntax unified 1585 .arm 1587 main: 1588 .LFB69: 125:apps/loader/main.c **** /* Simulate a compal loader saying "ACK" */ 1589 .loc 1 125 1 view -0 1590 .cfi_startproc 1591 @ Function supports interworking. 1592 @ args = 0, pretend = 0, frame = 0 1593 @ frame_needed = 0, uses_anonymous_args = 0 127:apps/loader/main.c **** for (i = 0; i < sizeof(phone_ack); i++) { 1594 .loc 1 127 2 view .LVU430 1595 .LVL189: 128:apps/loader/main.c **** putchar_asm(phone_ack[i]); 1596 .loc 1 128 2 view .LVU431 128:apps/loader/main.c **** putchar_asm(phone_ack[i]); 1597 .loc 1 128 16 view .LVU432 125:apps/loader/main.c **** /* Simulate a compal loader saying "ACK" */ 1598 .loc 1 125 1 is_stmt 0 view .LVU433 1599 0000 F0412DE9 push {r4, r5, r6, r7, r8, lr} 1600 .LCFI19: 1601 .cfi_def_cfa_offset 24 1602 .cfi_offset 4, -24 1603 .cfi_offset 5, -20 1604 .cfi_offset 6, -16 1605 .cfi_offset 7, -12 1606 .cfi_offset 8, -8 1607 .cfi_offset 14, -4 128:apps/loader/main.c **** putchar_asm(phone_ack[i]); 1608 .loc 1 128 9 view .LVU434 1609 0004 0040A0E3 mov r4, #0 1610 0008 F8519FE5 ldr r5, .L89 1611 .LVL190: 1612 .L77: 129:apps/loader/main.c **** } 1613 .loc 1 129 3 is_stmt 1 discriminator 3 view .LVU435 1614 000c 0100D5E4 ldrb r0, [r5], #1 @ zero_extendqisi2 128:apps/loader/main.c **** putchar_asm(phone_ack[i]); 1615 .loc 1 128 38 is_stmt 0 discriminator 3 view .LVU436 1616 0010 014084E2 add r4, r4, #1 1617 .LVL191: 129:apps/loader/main.c **** } 1618 .loc 1 129 3 discriminator 3 view .LVU437 1619 0014 FEFFFFEB bl putchar_asm 1620 .LVL192: 128:apps/loader/main.c **** putchar_asm(phone_ack[i]); 1621 .loc 1 128 38 is_stmt 1 discriminator 3 view .LVU438 128:apps/loader/main.c **** putchar_asm(phone_ack[i]); 1622 .loc 1 128 16 discriminator 3 view .LVU439 1623 0018 070054E3 cmp r4, #7 1624 001c FAFFFF1A bne .L77 133:apps/loader/main.c **** sercomm_uart = sercomm_get_uart(); 1625 .loc 1 133 2 view .LVU440 1626 0020 0000A0E3 mov r0, #0 1627 0024 FEFFFFEB bl board_init 1628 .LVL193: 134:apps/loader/main.c **** 1629 .loc 1 134 2 view .LVU441 134:apps/loader/main.c **** 1630 .loc 1 134 17 is_stmt 0 view .LVU442 1631 0028 FEFFFFEB bl sercomm_get_uart 1632 .LVL194: 134:apps/loader/main.c **** 1633 .loc 1 134 15 view .LVU443 1634 002c D8519FE5 ldr r5, .L89+4 1635 0030 000085E5 str r0, [r5] 137:apps/loader/main.c **** puts(hr); 1636 .loc 1 137 2 is_stmt 1 view .LVU444 1637 0034 D4019FE5 ldr r0, .L89+8 1638 0038 FEFFFFEB bl puts 1639 .LVL195: 138:apps/loader/main.c **** 1640 .loc 1 138 2 view .LVU445 1641 003c D0319FE5 ldr r3, .L89+12 1642 .LBB184: 1643 .LBB185: 1644 .file 4 "include/fb/framebuffer.h" 1:include/fb/framebuffer.h **** #ifndef _FB_FRAMEBUFFER_H 2:include/fb/framebuffer.h **** #define _FB_FRAMEBUFFER_H 3:include/fb/framebuffer.h **** 4:include/fb/framebuffer.h **** #include 5:include/fb/framebuffer.h **** #include 6:include/fb/framebuffer.h **** 7:include/fb/framebuffer.h **** /* color is encoded as */ 8:include/fb/framebuffer.h **** /* if a color is "special", then the RGB components most likely 9:include/fb/framebuffer.h **** don't make sense. Use "special" colours when you have to 10:include/fb/framebuffer.h **** mask out bits with transparency or you have to encode 11:include/fb/framebuffer.h **** colours in a fixed color palette ... */ 12:include/fb/framebuffer.h **** 13:include/fb/framebuffer.h **** #define FB_COLOR_WHITE 0x00ffffffU 14:include/fb/framebuffer.h **** #define FB_COLOR_BLACK 0x00000000U 15:include/fb/framebuffer.h **** #define FB_COLOR_TRANSP 0x01ffffffU 16:include/fb/framebuffer.h **** 17:include/fb/framebuffer.h **** #define FB_COLOR_RGB(r,g,b) ((((r) & 0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)) 18:include/fb/framebuffer.h **** #define FB_COLOR_RED FB_COLOR_RGB(0xff,0x00,0x00) 19:include/fb/framebuffer.h **** #define FB_COLOR_GREEN FB_COLOR_RGB(0x00,0xff,0x00) 20:include/fb/framebuffer.h **** #define FB_COLOR_BLUE FB_COLOR_RGB(0x00,0x00,0xff) 21:include/fb/framebuffer.h **** 22:include/fb/framebuffer.h **** /* encode */ 23:include/fb/framebuffer.h **** 24:include/fb/framebuffer.h **** /* decode */ 25:include/fb/framebuffer.h **** #define FB_COLOR_IS_SPECIAL(v) (!!((v) & 0xff000000U)) 26:include/fb/framebuffer.h **** #define FB_COLOR_TO_R(v) (((v)>>16) & 0xff) 27:include/fb/framebuffer.h **** #define FB_COLOR_TO_G(v) (((v)>> 8) & 0xff) 28:include/fb/framebuffer.h **** #define FB_COLOR_TO_B(v) ( (v) & 0xff) 29:include/fb/framebuffer.h **** 30:include/fb/framebuffer.h **** struct framebuffer { 31:include/fb/framebuffer.h **** char name[8]; // keep it short! 32:include/fb/framebuffer.h **** void (*init)(); // (re)initialize 33:include/fb/framebuffer.h **** void (*clear)(); // clear display 34:include/fb/framebuffer.h **** void (*set_p)(uint16_t x,uint16_t y); // set pixel to fg color 35:include/fb/framebuffer.h **** void (*boxto)(uint16_t x,uint16_t y); // draw box to xy 36:include/fb/framebuffer.h **** void (*lineto)(uint16_t x,uint16_t y); // draw line to xy 37:include/fb/framebuffer.h **** int (*putstr)(char *c,int maxwidth); // put text in current font to fb 38:include/fb/framebuffer.h **** void (*flush)(); // flush changes 39:include/fb/framebuffer.h **** 40:include/fb/framebuffer.h **** uint16_t width,height; // width/height of fb 41:include/fb/framebuffer.h **** uint16_t cursor_x,cursor_y; // current cursor 42:include/fb/framebuffer.h **** uint32_t fg_color,bg_color; // current fg/bg color 43:include/fb/framebuffer.h **** enum fb_font_id font; // current font 44:include/fb/framebuffer.h **** }; 45:include/fb/framebuffer.h **** 46:include/fb/framebuffer.h **** /* there is a single framebuffer, the specific driver defines 47:include/fb/framebuffer.h **** the "framebuffer" symbol */ 48:include/fb/framebuffer.h **** extern struct framebuffer *framebuffer; 49:include/fb/framebuffer.h **** 50:include/fb/framebuffer.h **** static inline void 51:include/fb/framebuffer.h **** fb_init(){ 52:include/fb/framebuffer.h **** framebuffer->init(); 53:include/fb/framebuffer.h **** } 54:include/fb/framebuffer.h **** 55:include/fb/framebuffer.h **** static inline void 56:include/fb/framebuffer.h **** fb_clear(){ 57:include/fb/framebuffer.h **** framebuffer->clear(); 1645 .loc 4 57 13 is_stmt 0 view .LVU446 1646 0040 D0419FE5 ldr r4, .L89+16 1647 .LVL196: 1648 .loc 4 57 13 view .LVU447 1649 .LBE185: 1650 .LBE184: 138:apps/loader/main.c **** 1651 .loc 1 138 2 view .LVU448 1652 0044 000093E5 ldr r0, [r3] 1653 0048 FEFFFFEB bl puts 1654 .LVL197: 140:apps/loader/main.c **** 1655 .loc 1 140 2 is_stmt 1 view .LVU449 1656 .LBB187: 1657 .LBI184: 56:include/fb/framebuffer.h **** framebuffer->clear(); 1658 .loc 4 56 1 view .LVU450 1659 .LBB186: 1660 .loc 4 57 2 view .LVU451 1661 .loc 4 57 13 is_stmt 0 view .LVU452 1662 004c 003094E5 ldr r3, [r4] 1663 .loc 4 57 2 view .LVU453 1664 0050 0C3093E5 ldr r3, [r3, #12] 1665 0054 0FE0A0E1 mov lr, pc 1666 0058 13FF2FE1 bx r3 1667 .LVL198: 1668 .LBE186: 1669 .LBE187: 142:apps/loader/main.c **** fb_setbg(FB_COLOR_WHITE); 1670 .loc 1 142 2 is_stmt 1 view .LVU454 1671 .LBB188: 1672 .LBI188: 58:include/fb/framebuffer.h **** } 59:include/fb/framebuffer.h **** 60:include/fb/framebuffer.h **** static inline void 61:include/fb/framebuffer.h **** fb_boxto(uint16_t x,uint16_t y){ 62:include/fb/framebuffer.h **** framebuffer->boxto(x,y); 63:include/fb/framebuffer.h **** } 64:include/fb/framebuffer.h **** 65:include/fb/framebuffer.h **** static inline void 66:include/fb/framebuffer.h **** fb_lineto(uint16_t x,uint16_t y){ 67:include/fb/framebuffer.h **** framebuffer->lineto(x,y); 68:include/fb/framebuffer.h **** } 69:include/fb/framebuffer.h **** 70:include/fb/framebuffer.h **** static inline void 71:include/fb/framebuffer.h **** fb_set_p(uint16_t x,uint16_t y){ 72:include/fb/framebuffer.h **** framebuffer->set_p(x,y); 73:include/fb/framebuffer.h **** } 74:include/fb/framebuffer.h **** 75:include/fb/framebuffer.h **** static inline int 76:include/fb/framebuffer.h **** fb_putstr(char *str,int maxwidth){ 77:include/fb/framebuffer.h **** return framebuffer->putstr(str,maxwidth); 78:include/fb/framebuffer.h **** } 79:include/fb/framebuffer.h **** 80:include/fb/framebuffer.h **** static inline void 81:include/fb/framebuffer.h **** fb_flush(){ 82:include/fb/framebuffer.h **** framebuffer->flush(); 83:include/fb/framebuffer.h **** } 84:include/fb/framebuffer.h **** 85:include/fb/framebuffer.h **** static inline void 86:include/fb/framebuffer.h **** fb_gotoxy(uint16_t x,uint16_t y){ 87:include/fb/framebuffer.h **** framebuffer->cursor_x = x; 88:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 89:include/fb/framebuffer.h **** } 90:include/fb/framebuffer.h **** 91:include/fb/framebuffer.h **** static inline void 92:include/fb/framebuffer.h **** fb_setfg(uint32_t color){ 1673 .loc 4 92 1 view .LVU455 1674 .LBB189: 93:include/fb/framebuffer.h **** framebuffer->fg_color = color; 1675 .loc 4 93 2 view .LVU456 1676 .loc 4 93 13 is_stmt 0 view .LVU457 1677 005c 003094E5 ldr r3, [r4] 1678 .LVL199: 1679 .loc 4 93 13 view .LVU458 1680 .LBE189: 1681 .LBE188: 143:apps/loader/main.c **** fb_setfont(FB_FONT_HELVB14); 1682 .loc 1 143 2 is_stmt 1 view .LVU459 1683 .LBB192: 1684 .LBI192: 94:include/fb/framebuffer.h **** } 95:include/fb/framebuffer.h **** 96:include/fb/framebuffer.h **** static inline void 97:include/fb/framebuffer.h **** fb_setbg(uint32_t color){ 1685 .loc 4 97 1 view .LVU460 1686 .LBB193: 98:include/fb/framebuffer.h **** framebuffer->bg_color = color; 1687 .loc 4 98 2 view .LVU461 1688 .loc 4 98 2 is_stmt 0 view .LVU462 1689 .LBE193: 1690 .LBE192: 144:apps/loader/main.c **** 1691 .loc 1 144 2 is_stmt 1 view .LVU463 1692 .LBB196: 1693 .LBI196: 99:include/fb/framebuffer.h **** } 100:include/fb/framebuffer.h **** 101:include/fb/framebuffer.h **** static inline void 102:include/fb/framebuffer.h **** fb_setfont(enum fb_font_id fid){ 1694 .loc 4 102 1 view .LVU464 1695 .LBB197: 103:include/fb/framebuffer.h **** framebuffer->font = fid; 1696 .loc 4 103 2 view .LVU465 1697 .loc 4 103 2 is_stmt 0 view .LVU466 1698 .LBE197: 1699 .LBE196: 146:apps/loader/main.c **** fb_putstr("loader",framebuffer->width-4); 1700 .loc 1 146 2 is_stmt 1 view .LVU467 1701 .LBB200: 1702 .LBI200: 86:include/fb/framebuffer.h **** framebuffer->cursor_x = x; 1703 .loc 4 86 1 view .LVU468 1704 .LBB201: 87:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 1705 .loc 4 87 2 view .LVU469 88:include/fb/framebuffer.h **** } 1706 .loc 4 88 2 view .LVU470 87:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 1707 .loc 4 87 24 is_stmt 0 view .LVU471 1708 0060 B4219FE5 ldr r2, .L89+20 1709 .LBE201: 1710 .LBE200: 1711 .LBB203: 1712 .LBB190: 93:include/fb/framebuffer.h **** } 1713 .loc 4 93 24 view .LVU472 1714 0064 0060A0E3 mov r6, #0 1715 .LBE190: 1716 .LBE203: 1717 .LBB204: 1718 .LBB202: 87:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 1719 .loc 4 87 24 view .LVU473 1720 0068 282083E5 str r2, [r3, #40] 1721 .LBE202: 1722 .LBE204: 1723 .LBB205: 1724 .LBB194: 98:include/fb/framebuffer.h **** } 1725 .loc 4 98 24 view .LVU474 1726 006c FF74E0E3 mvn r7, #-16777216 1727 .LBE194: 1728 .LBE205: 1729 .LBB206: 1730 .LBB198: 1731 .loc 4 103 20 view .LVU475 1732 0070 0120A0E3 mov r2, #1 1733 .LBE198: 1734 .LBE206: 147:apps/loader/main.c **** 1735 .loc 1 147 32 view .LVU476 1736 0074 B412D3E1 ldrh r1, [r3, #36] 1737 .LBB207: 1738 .LBB199: 1739 .loc 4 103 20 view .LVU477 1740 0078 3420C3E5 strb r2, [r3, #52] 1741 .LVL200: 1742 .loc 4 103 20 view .LVU478 1743 .LBE199: 1744 .LBE207: 147:apps/loader/main.c **** 1745 .loc 1 147 2 is_stmt 1 view .LVU479 1746 .LBB208: 1747 .LBI208: 76:include/fb/framebuffer.h **** return framebuffer->putstr(str,maxwidth); 1748 .loc 4 76 1 view .LVU480 1749 .LBB209: 77:include/fb/framebuffer.h **** } 1750 .loc 4 77 2 view .LVU481 1751 .LBE209: 1752 .LBE208: 1753 .LBB211: 1754 .LBB191: 93:include/fb/framebuffer.h **** } 1755 .loc 4 93 24 is_stmt 0 view .LVU482 1756 007c 2C6083E5 str r6, [r3, #44] 1757 .LBE191: 1758 .LBE211: 1759 .LBB212: 1760 .LBB195: 98:include/fb/framebuffer.h **** } 1761 .loc 4 98 24 view .LVU483 1762 0080 307083E5 str r7, [r3, #48] 1763 .LBE195: 1764 .LBE212: 1765 .LBB213: 1766 .LBB210: 77:include/fb/framebuffer.h **** } 1767 .loc 4 77 9 view .LVU484 1768 0084 041041E2 sub r1, r1, #4 1769 .LVL201: 77:include/fb/framebuffer.h **** } 1770 .loc 4 77 9 view .LVU485 1771 0088 1C3093E5 ldr r3, [r3, #28] 1772 008c 8C019FE5 ldr r0, .L89+24 1773 0090 0FE0A0E1 mov lr, pc 1774 0094 13FF2FE1 bx r3 1775 .LVL202: 77:include/fb/framebuffer.h **** } 1776 .loc 4 77 9 view .LVU486 1777 .LBE210: 1778 .LBE213: 149:apps/loader/main.c **** fb_setbg(FB_COLOR_BLUE); 1779 .loc 1 149 2 is_stmt 1 view .LVU487 1780 .LBB214: 1781 .LBI214: 92:include/fb/framebuffer.h **** framebuffer->fg_color = color; 1782 .loc 4 92 1 view .LVU488 1783 .LBB215: 93:include/fb/framebuffer.h **** } 1784 .loc 4 93 2 view .LVU489 93:include/fb/framebuffer.h **** } 1785 .loc 4 93 13 is_stmt 0 view .LVU490 1786 0098 003094E5 ldr r3, [r4] 1787 .LVL203: 93:include/fb/framebuffer.h **** } 1788 .loc 4 93 13 view .LVU491 1789 .LBE215: 1790 .LBE214: 150:apps/loader/main.c **** 1791 .loc 1 150 2 is_stmt 1 view .LVU492 1792 .LBB217: 1793 .LBI217: 97:include/fb/framebuffer.h **** framebuffer->bg_color = color; 1794 .loc 4 97 1 view .LVU493 1795 .LBB218: 98:include/fb/framebuffer.h **** } 1796 .loc 4 98 2 view .LVU494 98:include/fb/framebuffer.h **** } 1797 .loc 4 98 2 is_stmt 0 view .LVU495 1798 .LBE218: 1799 .LBE217: 152:apps/loader/main.c **** fb_boxto(framebuffer->width-3,38); 1800 .loc 1 152 2 is_stmt 1 view .LVU496 1801 .LBB221: 1802 .LBI221: 86:include/fb/framebuffer.h **** framebuffer->cursor_x = x; 1803 .loc 4 86 1 view .LVU497 1804 .LBB222: 87:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 1805 .loc 4 87 2 view .LVU498 88:include/fb/framebuffer.h **** } 1806 .loc 4 88 2 view .LVU499 87:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 1807 .loc 4 87 24 is_stmt 0 view .LVU500 1808 009c 80219FE5 ldr r2, .L89+28 1809 00a0 282083E5 str r2, [r3, #40] 1810 .LBE222: 1811 .LBE221: 1812 .LBB223: 1813 .LBB216: 93:include/fb/framebuffer.h **** } 1814 .loc 4 93 24 view .LVU501 1815 00a4 FF28A0E3 mov r2, #16711680 1816 00a8 2C2083E5 str r2, [r3, #44] 1817 .LBE216: 1818 .LBE223: 1819 .LBB224: 1820 .LBB219: 98:include/fb/framebuffer.h **** } 1821 .loc 4 98 24 view .LVU502 1822 00ac FF20A0E3 mov r2, #255 1823 .LBE219: 1824 .LBE224: 153:apps/loader/main.c **** 1825 .loc 1 153 2 view .LVU503 1826 00b0 B402D3E1 ldrh r0, [r3, #36] 1827 00b4 030040E2 sub r0, r0, #3 1828 .LBB225: 1829 .LBB226: 62:include/fb/framebuffer.h **** } 1830 .loc 4 62 2 view .LVU504 1831 00b8 0008A0E1 lsl r0, r0, #16 1832 .LBE226: 1833 .LBE225: 1834 .LBB228: 1835 .LBB220: 98:include/fb/framebuffer.h **** } 1836 .loc 4 98 24 view .LVU505 1837 00bc 302083E5 str r2, [r3, #48] 1838 .LVL204: 98:include/fb/framebuffer.h **** } 1839 .loc 4 98 24 view .LVU506 1840 .LBE220: 1841 .LBE228: 153:apps/loader/main.c **** 1842 .loc 1 153 2 is_stmt 1 view .LVU507 1843 .LBB229: 1844 .LBI225: 61:include/fb/framebuffer.h **** framebuffer->boxto(x,y); 1845 .loc 4 61 1 view .LVU508 1846 .LBB227: 62:include/fb/framebuffer.h **** } 1847 .loc 4 62 2 view .LVU509 1848 00c0 2610A0E3 mov r1, #38 1849 00c4 143093E5 ldr r3, [r3, #20] 1850 .LVL205: 62:include/fb/framebuffer.h **** } 1851 .loc 4 62 2 is_stmt 0 view .LVU510 1852 00c8 2008A0E1 lsr r0, r0, #16 1853 00cc 0FE0A0E1 mov lr, pc 1854 00d0 13FF2FE1 bx r3 1855 .LVL206: 62:include/fb/framebuffer.h **** } 1856 .loc 4 62 2 view .LVU511 1857 .LBE227: 1858 .LBE229: 155:apps/loader/main.c **** fb_setfont(FB_FONT_HELVR08); 1859 .loc 1 155 2 is_stmt 1 view .LVU512 1860 .LBB230: 1861 .LBI230: 92:include/fb/framebuffer.h **** framebuffer->fg_color = color; 1862 .loc 4 92 1 view .LVU513 1863 .LBB231: 93:include/fb/framebuffer.h **** } 1864 .loc 4 93 2 view .LVU514 93:include/fb/framebuffer.h **** } 1865 .loc 4 93 13 is_stmt 0 view .LVU515 1866 00d4 003094E5 ldr r3, [r4] 1867 .LVL207: 93:include/fb/framebuffer.h **** } 1868 .loc 4 93 13 view .LVU516 1869 .LBE231: 1870 .LBE230: 156:apps/loader/main.c **** fb_gotoxy(8,33); 1871 .loc 1 156 2 is_stmt 1 view .LVU517 1872 .LBB233: 1873 .LBI233: 102:include/fb/framebuffer.h **** framebuffer->font = fid; 1874 .loc 4 102 1 view .LVU518 1875 .LBB234: 1876 .loc 4 103 2 view .LVU519 1877 .LBE234: 1878 .LBE233: 1879 .LBB236: 1880 .LBB237: 87:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 1881 .loc 4 87 24 is_stmt 0 view .LVU520 1882 00d8 48219FE5 ldr r2, .L89+32 1883 .LBE237: 1884 .LBE236: 158:apps/loader/main.c **** 1885 .loc 1 158 36 view .LVU521 1886 00dc B412D3E1 ldrh r1, [r3, #36] 1887 .LBB240: 1888 .LBB238: 87:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 1889 .loc 4 87 24 view .LVU522 1890 00e0 282083E5 str r2, [r3, #40] 1891 .LBE238: 1892 .LBE240: 1893 .LBB241: 1894 .LBB242: 77:include/fb/framebuffer.h **** } 1895 .loc 4 77 9 view .LVU523 1896 00e4 041041E2 sub r1, r1, #4 1897 .LBE242: 1898 .LBE241: 1899 .LBB244: 1900 .LBB235: 1901 .loc 4 103 20 view .LVU524 1902 00e8 3460C3E5 strb r6, [r3, #52] 1903 .LVL208: 1904 .loc 4 103 20 view .LVU525 1905 .LBE235: 1906 .LBE244: 157:apps/loader/main.c **** fb_putstr("osmocom-bb",framebuffer->width-4); 1907 .loc 1 157 2 is_stmt 1 view .LVU526 1908 .LBB245: 1909 .LBI236: 86:include/fb/framebuffer.h **** framebuffer->cursor_x = x; 1910 .loc 4 86 1 view .LVU527 1911 .LBB239: 87:include/fb/framebuffer.h **** framebuffer->cursor_y = y; 1912 .loc 4 87 2 view .LVU528 88:include/fb/framebuffer.h **** } 1913 .loc 4 88 2 view .LVU529 1914 .LBE239: 1915 .LBE245: 1916 .LBB246: 1917 .LBB232: 93:include/fb/framebuffer.h **** } 1918 .loc 4 93 24 is_stmt 0 view .LVU530 1919 00ec 2C7083E5 str r7, [r3, #44] 1920 .LVL209: 93:include/fb/framebuffer.h **** } 1921 .loc 4 93 24 view .LVU531 1922 .LBE232: 1923 .LBE246: 158:apps/loader/main.c **** 1924 .loc 1 158 2 is_stmt 1 view .LVU532 1925 .LBB247: 1926 .LBI241: 76:include/fb/framebuffer.h **** return framebuffer->putstr(str,maxwidth); 1927 .loc 4 76 1 view .LVU533 1928 .LBB243: 77:include/fb/framebuffer.h **** } 1929 .loc 4 77 2 view .LVU534 77:include/fb/framebuffer.h **** } 1930 .loc 4 77 9 is_stmt 0 view .LVU535 1931 00f0 34019FE5 ldr r0, .L89+36 1932 00f4 1C3093E5 ldr r3, [r3, #28] 1933 00f8 0FE0A0E1 mov lr, pc 1934 00fc 13FF2FE1 bx r3 1935 .LVL210: 77:include/fb/framebuffer.h **** } 1936 .loc 4 77 9 view .LVU536 1937 .LBE243: 1938 .LBE247: 160:apps/loader/main.c **** 1939 .loc 1 160 2 is_stmt 1 view .LVU537 1940 .LBB248: 1941 .LBI248: 81:include/fb/framebuffer.h **** framebuffer->flush(); 1942 .loc 4 81 1 view .LVU538 1943 .LBB249: 82:include/fb/framebuffer.h **** } 1944 .loc 4 82 2 view .LVU539 82:include/fb/framebuffer.h **** } 1945 .loc 4 82 13 is_stmt 0 view .LVU540 1946 0100 003094E5 ldr r3, [r4] 82:include/fb/framebuffer.h **** } 1947 .loc 4 82 2 view .LVU541 1948 0104 203093E5 ldr r3, [r3, #32] 1949 0108 0FE0A0E1 mov lr, pc 1950 010c 13FF2FE1 bx r3 1951 .LVL211: 1952 .LBE249: 1953 .LBE248: 163:apps/loader/main.c **** manifest_environment); 1954 .loc 1 163 2 is_stmt 1 view .LVU542 1955 0110 18319FE5 ldr r3, .L89+40 1956 0114 002093E5 ldr r2, [r3] 1957 0118 14319FE5 ldr r3, .L89+44 1958 011c 14019FE5 ldr r0, .L89+48 1959 0120 001093E5 ldr r1, [r3] 1960 0124 FEFFFFEB bl printf 1961 .LVL212: 167:apps/loader/main.c **** puts("Failed to initialize flash!\n"); 1962 .loc 1 167 2 view .LVU543 167:apps/loader/main.c **** puts("Failed to initialize flash!\n"); 1963 .loc 1 167 6 is_stmt 0 view .LVU544 1964 0128 0610A0E1 mov r1, r6 1965 012c 040085E2 add r0, r5, #4 1966 0130 FEFFFFEB bl flash_init 1967 .LVL213: 167:apps/loader/main.c **** puts("Failed to initialize flash!\n"); 1968 .loc 1 167 5 view .LVU545 1969 0134 004050E2 subs r4, r0, #0 1970 0138 2100000A beq .L78 168:apps/loader/main.c **** } else { 1971 .loc 1 168 3 is_stmt 1 view .LVU546 1972 013c F8009FE5 ldr r0, .L89+52 1973 0140 FEFFFFEB bl puts 1974 .LVL214: 1975 .L79: 184:apps/loader/main.c **** 1976 .loc 1 184 2 view .LVU547 1977 0144 F4009FE5 ldr r0, .L89+56 1978 0148 FEFFFFEB bl keypad_set_handler 1979 .LVL215: 187:apps/loader/main.c **** 1980 .loc 1 187 2 view .LVU548 1981 014c F0109FE5 ldr r1, .L89+60 1982 0150 0900A0E3 mov r0, #9 1983 0154 FEFFFFEB bl sercomm_register_rx_cb 1984 .LVL216: 190:apps/loader/main.c **** 1985 .loc 1 190 2 view .LVU549 1986 .LBB250: 1987 .LBI250: 109:apps/loader/main.c **** { 1988 .loc 1 109 13 view .LVU550 1989 .LBB251: 111:apps/loader/main.c **** msgb_put_u8(msg, LOADER_INIT); 1990 .loc 1 111 2 view .LVU551 1991 .LBB252: 1992 .LBI252: 54:include/comm/sercomm.h **** { 1993 .loc 3 54 28 view .LVU552 1994 .loc 3 56 2 view .LVU553 1995 .LBB253: 1996 .LBI253: 379:../../shared/libosmocore/include/osmocom/core/msgb.h **** const char *name) 1997 .loc 2 379 28 view .LVU554 1998 .LBB254: 382:../../shared/libosmocore/include/osmocom/core/msgb.h **** 1999 .loc 2 382 2 view .LVU555 382:../../shared/libosmocore/include/osmocom/core/msgb.h **** 2000 .loc 2 382 54 view .LVU556 384:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (msg) 2001 .loc 2 384 2 view .LVU557 384:../../shared/libosmocore/include/osmocom/core/msgb.h **** if (msg) 2002 .loc 2 384 21 is_stmt 0 view .LVU558 2003 0158 0D00A0E3 mov r0, #13 2004 015c E4109FE5 ldr r1, .L89+64 2005 0160 FEFFFFEB bl msgb_alloc 2006 .LVL217: 385:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_reserve(msg, headroom); 2007 .loc 2 385 2 is_stmt 1 view .LVU559 385:../../shared/libosmocore/include/osmocom/core/msgb.h **** msgb_reserve(msg, headroom); 2008 .loc 2 385 5 is_stmt 0 view .LVU560 2009 0164 004050E2 subs r4, r0, #0 2010 0168 0500000A beq .L82 386:../../shared/libosmocore/include/osmocom/core/msgb.h **** return msg; 2011 .loc 2 386 3 is_stmt 1 view .LVU561 2012 .LVL218: 2013 .LBB255: 2014 .LBI255: 337:../../shared/libosmocore/include/osmocom/core/msgb.h **** { 2015 .loc 2 337 20 view .LVU562 2016 .LBB256: 339:../../shared/libosmocore/include/osmocom/core/msgb.h **** msg->tail += len; 2017 .loc 2 339 2 view .LVU563 339:../../shared/libosmocore/include/osmocom/core/msgb.h **** msg->tail += len; 2018 .loc 2 339 12 is_stmt 0 view .LVU564 2019 016c 403094E5 ldr r3, [r4, #64] 2020 0170 043083E2 add r3, r3, #4 2021 0174 403084E5 str r3, [r4, #64] 340:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 2022 .loc 2 340 2 is_stmt 1 view .LVU565 340:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 2023 .loc 2 340 12 is_stmt 0 view .LVU566 2024 0178 3C3094E5 ldr r3, [r4, #60] 2025 017c 043083E2 add r3, r3, #4 2026 0180 3C3084E5 str r3, [r4, #60] 2027 .LVL219: 2028 .L82: 340:../../shared/libosmocore/include/osmocom/core/msgb.h **** } 2029 .loc 2 340 12 view .LVU567 2030 .LBE256: 2031 .LBE255: 2032 .loc 2 387 2 is_stmt 1 view .LVU568 2033 .loc 2 387 2 is_stmt 0 view .LVU569 2034 .LBE254: 2035 .LBE253: 2036 .LBE252: 112:apps/loader/main.c **** msgb_put_u32(msg, 0); 2037 .loc 1 112 2 is_stmt 1 view .LVU570 2038 0184 0010A0E3 mov r1, #0 2039 0188 0400A0E1 mov r0, r4 112:apps/loader/main.c **** msgb_put_u32(msg, 0); 2040 .loc 1 112 2 is_stmt 0 view .LVU571 2041 018c FEFFFFEB bl msgb_put_u8 2042 .LVL220: 113:apps/loader/main.c **** msgb_put_u32(msg, (uint32_t)&_start); 2043 .loc 1 113 2 is_stmt 1 view .LVU572 2044 0190 0010A0E3 mov r1, #0 2045 0194 0400A0E1 mov r0, r4 2046 0198 FEFFFFEB bl msgb_put_u32 2047 .LVL221: 114:apps/loader/main.c **** sercomm_sendmsg(dlci, msg); 2048 .loc 1 114 2 view .LVU573 2049 019c 0400A0E1 mov r0, r4 2050 01a0 A4109FE5 ldr r1, .L89+68 2051 01a4 FEFFFFEB bl msgb_put_u32 2052 .LVL222: 115:apps/loader/main.c **** } 2053 .loc 1 115 2 view .LVU574 2054 01a8 0410A0E1 mov r1, r4 2055 01ac 0900A0E3 mov r0, #9 2056 01b0 FEFFFFEB bl sercomm_sendmsg 2057 .LVL223: 2058 .L83: 115:apps/loader/main.c **** } 2059 .loc 1 115 2 is_stmt 0 view .LVU575 2060 .LBE251: 2061 .LBE250: 193:apps/loader/main.c **** keypad_poll(); 2062 .loc 1 193 2 is_stmt 1 discriminator 1 view .LVU576 194:apps/loader/main.c **** uart_poll(sercomm_uart); 2063 .loc 1 194 3 discriminator 1 view .LVU577 2064 01b4 FEFFFFEB bl keypad_poll 2065 .LVL224: 195:apps/loader/main.c **** } 2066 .loc 1 195 3 discriminator 1 view .LVU578 2067 01b8 0000D5E5 ldrb r0, [r5] @ zero_extendqisi2 2068 01bc FEFFFFEB bl uart_poll 2069 .LVL225: 193:apps/loader/main.c **** keypad_poll(); 2070 .loc 1 193 8 discriminator 1 view .LVU579 2071 01c0 FBFFFFEA b .L83 2072 .LVL226: 2073 .L78: 170:apps/loader/main.c **** the_flash.f_size, the_flash.f_base, 2074 .loc 1 170 3 view .LVU580 2075 01c4 0C3095E5 ldr r3, [r5, #12] 2076 01c8 042095E5 ldr r2, [r5, #4] 2077 01cc 081095E5 ldr r1, [r5, #8] 2078 01d0 78009FE5 ldr r0, .L89+72 2079 01d4 FEFFFFEB bl printf 2080 .LVL227: 174:apps/loader/main.c **** printf(" Region %d of %zu pages with %zu bytes each.\n", 2081 .loc 1 174 3 view .LVU581 175:apps/loader/main.c **** i, 2082 .loc 1 175 4 is_stmt 0 view .LVU582 2083 01d8 74709FE5 ldr r7, .L89+76 2084 01dc 046085E2 add r6, r5, #4 2085 .LVL228: 2086 .L80: 174:apps/loader/main.c **** printf(" Region %d of %zu pages with %zu bytes each.\n", 2087 .loc 1 174 17 is_stmt 1 discriminator 1 view .LVU583 2088 01e0 0C3095E5 ldr r3, [r5, #12] 2089 01e4 040053E1 cmp r3, r4 2090 01e8 0C6086E2 add r6, r6, #12 2091 01ec D4FFFF9A bls .L79 175:apps/loader/main.c **** i, 2092 .loc 1 175 4 discriminator 3 view .LVU584 2093 01f0 0410A0E1 mov r1, r4 2094 01f4 0700A0E1 mov r0, r7 2095 01f8 0C0096E9 ldmib r6, {r2, r3} 2096 01fc FEFFFFEB bl printf 2097 .LVL229: 174:apps/loader/main.c **** printf(" Region %d of %zu pages with %zu bytes each.\n", 2098 .loc 1 174 42 discriminator 3 view .LVU585 2099 0200 014084E2 add r4, r4, #1 2100 .LVL230: 174:apps/loader/main.c **** printf(" Region %d of %zu pages with %zu bytes each.\n", 2101 .loc 1 174 42 is_stmt 0 discriminator 3 view .LVU586 2102 0204 F5FFFFEA b .L80 2103 .L90: 2104 .align 2 2105 .L89: 2106 0208 00000000 .word .LANCHOR1 2107 020c 00000000 .word .LANCHOR0 2108 0210 AE000000 .word .LC6 2109 0214 00000000 .word .LANCHOR2 2110 0218 00000000 .word framebuffer 2111 021c 02001400 .word 1310722 2112 0220 EB000000 .word .LC7 2113 0224 02001900 .word 1638402 2114 0228 08002100 .word 2162696 2115 022c F2000000 .word .LC8 2116 0230 00000000 .word manifest_environment 2117 0234 00000000 .word manifest_board 2118 0238 FD000000 .word .LC9 2119 023c 1E010000 .word .LC10 2120 0240 00000000 .word key_handler 2121 0244 00000000 .word cmd_handler 2122 0248 6E000000 .word .LC3 2123 024c 00000000 .word _start 2124 0250 3B010000 .word .LC11 2125 0254 6E010000 .word .LC12 2126 .cfi_endproc 2127 .LFE69: 2129 .global the_flash 2130 .global flag 2131 .global hr 2132 .section .rodata.str1.1 2133 .LC13: 2134 019d 3D3D3D3D .ascii "===================================================" 2134 3D3D3D3D 2134 3D3D3D3D 2134 3D3D3D3D 2134 3D3D3D3D 2135 01d0 3D3D3D3D .ascii "===================\012\000" 2135 3D3D3D3D 2135 3D3D3D3D 2135 3D3D3D3D 2135 3D3D3D0A 2136 .section .rodata 2137 .set .LANCHOR1,. + 0 2140 phone_ack: 2141 0000 1BF60200 .ascii "\033\366\002\000A\003B" 2141 410342 2142 .data 2143 .align 2 2144 .set .LANCHOR2,. + 0 2147 hr: 2148 0000 9D010000 .word .LC13 2149 .bss 2150 .align 2 2151 .set .LANCHOR0,. + 0 2154 sercomm_uart: 2155 0000 00000000 .space 4 2158 the_flash: 2159 0004 00000000 .space 60 2159 00000000 2159 00000000 2159 00000000 2159 00000000 2162 flag: 2163 0040 00000000 .space 4 2164 .text 2165 .Letext0: 2166 .file 5 "/usr/lib/gcc/arm-none-eabi/12.2.1/include/stdint.h" 2167 .file 6 "/usr/lib/gcc/arm-none-eabi/12.2.1/include/stddef.h" 2168 .file 7 "include/keypad.h" 2169 .file 8 "include/manifest.h" 2170 .file 9 "../../shared/libosmocore/include/osmocom/core/linuxlist.h" 2171 .file 10 "include/fb/font.h" 2172 .file 11 "include/flash/cfi_flash.h" 2173 .file 12 "apps/loader/protocol.h" 2174 .file 13 "../../shared/libosmocore/include/osmocom/core/panic.h" 2175 .file 14 "include/calypso/clock.h" 2176 .file 15 "include/delay.h" 2177 .file 16 "include/abb/twl3025.h" 2178 .file 17 "include/calypso/timer.h" 2179 .file 18 "include/string.h" 2180 .file 19 "../../shared/libosmocore/include/osmocom/core/crc16.h" 2181 .file 20 "include/uart.h" 2182 .file 21 "include/stdio.h" 2183 .file 22 "include/board.h" 2184 .file 23 "" DEFINED SYMBOLS *ABS*:00000000 main.c /tmp/ccgAu6Gw.s:19 .text.msgb_pull_u8:00000000 $a /tmp/ccgAu6Gw.s:23 .text.msgb_pull_u8:00000000 msgb_pull_u8 /tmp/ccgAu6Gw.s:63 .text.msgb_pull_u32:00000000 $a /tmp/ccgAu6Gw.s:67 .text.msgb_pull_u32:00000000 msgb_pull_u32 /tmp/ccgAu6Gw.s:120 .text.flush_uart:00000000 $a /tmp/ccgAu6Gw.s:124 .text.flush_uart:00000000 flush_uart /tmp/ccgAu6Gw.s:177 .text.flush_uart:0000002c $d /tmp/ccgAu6Gw.s:186 .text.msgb_put:00000000 $a /tmp/ccgAu6Gw.s:190 .text.msgb_put:00000000 msgb_put /tmp/ccgAu6Gw.s:280 .text.msgb_put:0000005c $d /tmp/ccgAu6Gw.s:285 .text.msgb_put_u16:00000000 $a /tmp/ccgAu6Gw.s:289 .text.msgb_put_u16:00000000 msgb_put_u16 /tmp/ccgAu6Gw.s:330 .text.msgb_put_u8:00000000 $a /tmp/ccgAu6Gw.s:334 .text.msgb_put_u8:00000000 msgb_put_u8 /tmp/ccgAu6Gw.s:371 .text.loader_send_simple:00000000 $a /tmp/ccgAu6Gw.s:375 .text.loader_send_simple:00000000 loader_send_simple /tmp/ccgAu6Gw.s:421 .text.msgb_put_u32:00000000 $a /tmp/ccgAu6Gw.s:425 .text.msgb_put_u32:00000000 msgb_put_u32 /tmp/ccgAu6Gw.s:484 .text.key_handler:00000000 $a /tmp/ccgAu6Gw.s:488 .text.key_handler:00000000 key_handler /tmp/ccgAu6Gw.s:570 .text.key_handler:00000048 $d /tmp/ccgAu6Gw.s:587 .text.cmd_handler:00000000 $a /tmp/ccgAu6Gw.s:591 .text.cmd_handler:00000000 cmd_handler /tmp/ccgAu6Gw.s:749 .text.cmd_handler:0000007c $d /tmp/ccgAu6Gw.s:767 .text.cmd_handler:000000b8 $a /tmp/ccgAu6Gw.s:1553 .text.cmd_handler:00000560 $d /tmp/ccgAu6Gw.s:1582 .text.startup.main:00000000 $a /tmp/ccgAu6Gw.s:1587 .text.startup.main:00000000 main /tmp/ccgAu6Gw.s:2106 .text.startup.main:00000208 $d /tmp/ccgAu6Gw.s:2158 .bss:00000004 the_flash /tmp/ccgAu6Gw.s:2162 .bss:00000040 flag /tmp/ccgAu6Gw.s:2147 .data:00000000 hr /tmp/ccgAu6Gw.s:2140 .rodata:00000000 phone_ack /tmp/ccgAu6Gw.s:2143 .data:00000000 $d /tmp/ccgAu6Gw.s:2150 .bss:00000000 $d /tmp/ccgAu6Gw.s:2154 .bss:00000000 sercomm_uart UNDEFINED SYMBOLS uart_poll delay_ms osmo_panic sercomm_sendmsg puts twl3025_power_off wdog_reset msgb_alloc msgb_free calypso_bootrom osmo_crc16 memcpy flash_block_lockdown flash_block_erase flash_block_unlock flash_block_lock flash_block_getlock flash_program printf putchar_asm board_init sercomm_get_uart flash_init keypad_set_handler sercomm_register_rx_cb keypad_poll framebuffer manifest_environment manifest_board _start