jmemmgr.txt

来自「STM32F103ZET6+UCOSII+UCGUI源码」· 文本 代码 · 共 1,415 行 · 第 1/5 页

TXT
1,415
字号
; generated by ARM C/C++ Compiler with , RVCT4.0 [Build 524] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Obj\jmemmgr.o --depend=.\Obj\jmemmgr.d --device=DARMSTM --apcs=interwork -O3 -I..\..\include -I..\..\..\FWLib\library\inc -I..\..\..\USBLib\library\inc -I..\..\Config -I..\..\GUI\Core -I..\..\GUI\Font -I..\..\GUI\ConvertColor -I..\..\GUI\AntiAlias -I..\..\GUI\ConvertMono -I..\..\GUI\JPEG -I..\..\GUI\MemDev -I..\..\GUI\MultiLayer -I..\..\GUI\Widget -I..\..\GUI\WM -IC:\Keil\ARM\INC\ST\STM32F10x ..\..\GUI\JPEG\jmemmgr.c]
                          THUMB

                          AREA ||i.access_virt_barray||, CODE, READONLY, ALIGN=1

                  access_virt_barray PROC
;;;799    /* caller intends to modify the accessed area. */
;;;800    METHODDEF(JBLOCKARRAY) access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows,  boolean writable) {
000000  e92d47f0          PUSH     {r4-r10,lr}
000004  4605              MOV      r5,r0
;;;801      JDIMENSION end_row = start_row + num_rows;
;;;802      JDIMENSION undef_row;
;;;803    
;;;804      /* debugging check */
;;;805      if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
000006  6848              LDR      r0,[r1,#4]
000008  18d7              ADDS     r7,r2,r3              ;801
00000a  f8dd8020          LDR      r8,[sp,#0x20]
00000e  460c              MOV      r4,r1                 ;800
000010  4616              MOV      r6,r2                 ;800
;;;806          ptr->mem_buffer == NULL)
;;;807        ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
000012  f04f0916          MOV      r9,#0x16
000016  42b8              CMP      r0,r7                 ;805
000018  d304              BCC      |L1.36|
00001a  68e0              LDR      r0,[r4,#0xc]          ;805
00001c  4298              CMP      r0,r3                 ;805
00001e  d301              BCC      |L1.36|
000020  6820              LDR      r0,[r4,#0]            ;806
000022  b930              CBNZ     r0,|L1.50|
                  |L1.36|
000024  6829              LDR      r1,[r5,#0]
000026  f8c19014          STR      r9,[r1,#0x14]
00002a  6828              LDR      r0,[r5,#0]
00002c  6801              LDR      r1,[r0,#0]
00002e  4628              MOV      r0,r5
000030  4788              BLX      r1
                  |L1.50|
;;;808    
;;;809      /* Make the desired part of the virtual array accessible */
;;;810      if (start_row < ptr->cur_start_row ||
000032  69a0              LDR      r0,[r4,#0x18]
000034  42b0              CMP      r0,r6
000036  d803              BHI      |L1.64|
;;;811          end_row > ptr->cur_start_row+ptr->rows_in_mem) {
000038  6921              LDR      r1,[r4,#0x10]
00003a  4408              ADD      r0,r0,r1
00003c  42b8              CMP      r0,r7
00003e  d220              BCS      |L1.130|
                  |L1.64|
;;;812        if (! ptr->b_s_open)
000040  6aa0              LDR      r0,[r4,#0x28]
000042  b930              CBNZ     r0,|L1.82|
;;;813          ERREXIT(cinfo, JERR_VIRTUAL_BUG);
000044  6829              LDR      r1,[r5,#0]
000046  2045              MOVS     r0,#0x45
000048  6148              STR      r0,[r1,#0x14]
00004a  6828              LDR      r0,[r5,#0]
00004c  6801              LDR      r1,[r0,#0]
00004e  4628              MOV      r0,r5
000050  4788              BLX      r1
                  |L1.82|
;;;814        /* Flush old buffer contents if necessary */
;;;815        if (ptr->dirty) {
000052  6a60              LDR      r0,[r4,#0x24]
000054  b130              CBZ      r0,|L1.100|
;;;816          do_barray_io(cinfo, ptr, TRUE);
000056  2201              MOVS     r2,#1
000058  4621              MOV      r1,r4
00005a  4628              MOV      r0,r5
00005c  f7fffffe          BL       do_barray_io
;;;817          ptr->dirty = FALSE;
000060  2000              MOVS     r0,#0
000062  6260              STR      r0,[r4,#0x24]
                  |L1.100|
;;;818        }
;;;819        /* Decide what part of virtual array to access.
;;;820         * Algorithm: if target address > current window, assume forward scan,
;;;821         * load starting at target address.  If target address < current window,
;;;822         * assume backward scan, load so that target area is top of window.
;;;823         * Note that when switching from forward write to forward read, will have
;;;824         * start_row = 0, so the limiting case applies and we load from 0 anyway.
;;;825         */
;;;826        if (start_row > ptr->cur_start_row) {
000064  69a0              LDR      r0,[r4,#0x18]
000066  42b0              CMP      r0,r6
000068  d201              BCS      |L1.110|
;;;827          ptr->cur_start_row = start_row;
00006a  61a6              STR      r6,[r4,#0x18]
00006c  e004              B        |L1.120|
                  |L1.110|
;;;828        } else {
;;;829          /* use long arithmetic here to avoid overflow & unsigned problems */
;;;830          long ltemp;
;;;831    
;;;832          ltemp = (long) end_row - (long) ptr->rows_in_mem;
00006e  6920              LDR      r0,[r4,#0x10]
000070  1a38              SUBS     r0,r7,r0
;;;833          if (ltemp < 0)
000072  d500              BPL      |L1.118|
;;;834    	ltemp = 0;		/* don't fall off front end of file */
000074  2000              MOVS     r0,#0
                  |L1.118|
;;;835          ptr->cur_start_row = (JDIMENSION) ltemp;
000076  61a0              STR      r0,[r4,#0x18]
                  |L1.120|
;;;836        }
;;;837        /* Read in the selected part of the array.
;;;838         * During the initial write pass, we will do no actual read
;;;839         * because the selected part is all undefined.
;;;840         */
;;;841        do_barray_io(cinfo, ptr, FALSE);
000078  2200              MOVS     r2,#0
00007a  4621              MOV      r1,r4
00007c  4628              MOV      r0,r5
00007e  f7fffffe          BL       do_barray_io
                  |L1.130|
;;;842      }
;;;843      /* Ensure the accessed part of the array is defined; prezero if needed.
;;;844       * To improve locality of access, we only prezero the part of the array
;;;845       * that the caller is about to access, not the entire in-memory array.
;;;846       */
;;;847      if (ptr->first_undef_row < end_row) {
000082  69e0              LDR      r0,[r4,#0x1c]
000084  42b8              CMP      r0,r7
000086  d222              BCS      |L1.206|
;;;848        if (ptr->first_undef_row < start_row) {
000088  42b0              CMP      r0,r6
00008a  d20a              BCS      |L1.162|
;;;849          if (writable)		/* writer skipped over a section of array */
00008c  f1b80f00          CMP      r8,#0
000090  d006              BEQ      |L1.160|
;;;850    	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
000092  6829              LDR      r1,[r5,#0]
000094  f8c19014          STR      r9,[r1,#0x14]
000098  6828              LDR      r0,[r5,#0]
00009a  6801              LDR      r1,[r0,#0]
00009c  4628              MOV      r0,r5
00009e  4788              BLX      r1
                  |L1.160|
;;;851          undef_row = start_row;	/* but reader is allowed to read ahead */
0000a0  4630              MOV      r0,r6
                  |L1.162|
;;;852        } else {
;;;853          undef_row = ptr->first_undef_row;
;;;854        }
;;;855        if (writable)
0000a2  f1b80f00          CMP      r8,#0
0000a6  d000              BEQ      |L1.170|
;;;856          ptr->first_undef_row = end_row;
0000a8  61e7              STR      r7,[r4,#0x1c]
                  |L1.170|
;;;857        if (ptr->pre_zero) {
0000aa  6a21              LDR      r1,[r4,#0x20]
0000ac  b1d9              CBZ      r1,|L1.230|
;;;858          size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK);
;;;859          undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
0000ae  69a1              LDR      r1,[r4,#0x18]
0000b0  68a2              LDR      r2,[r4,#8]            ;858
0000b2  1a45              SUBS     r5,r0,r1
0000b4  ea4f19c2          LSL      r9,r2,#7              ;858
;;;860          end_row -= ptr->cur_start_row;
0000b8  1a7f              SUBS     r7,r7,r1
;;;861          while (undef_row < end_row) {
0000ba  e006              B        |L1.202|
                  |L1.188|
;;;862    	jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
0000bc  6820              LDR      r0,[r4,#0]
0000be  4649              MOV      r1,r9
0000c0  f8500025          LDR      r0,[r0,r5,LSL #2]
0000c4  f7fffffe          BL       jzero_far
;;;863    	undef_row++;
0000c8  1c6d              ADDS     r5,r5,#1
                  |L1.202|
0000ca  42bd              CMP      r5,r7                 ;861
0000cc  d3f6              BCC      |L1.188|
                  |L1.206|
;;;864          }
;;;865        } else {
;;;866          if (! writable)		/* reader looking at undefined data */
;;;867    	ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
;;;868        }
;;;869      }
;;;870      /* Flag the buffer dirty if caller will write in it */
;;;871      if (writable)
0000ce  f1b80f00          CMP      r8,#0
0000d2  d001              BEQ      |L1.216|
                  |L1.212|
;;;872        ptr->dirty = TRUE;
0000d4  2001              MOVS     r0,#1
0000d6  6260              STR      r0,[r4,#0x24]
                  |L1.216|
;;;873      /* Return address of proper part of the buffer */
;;;874      return ptr->mem_buffer + (start_row - ptr->cur_start_row);
0000d8  69a1              LDR      r1,[r4,#0x18]
0000da  6820              LDR      r0,[r4,#0]
0000dc  1a71              SUBS     r1,r6,r1
0000de  eb000081          ADD      r0,r0,r1,LSL #2
;;;875    }
0000e2  e8bd87f0          POP      {r4-r10,pc}
                  |L1.230|
0000e6  f1b80f00          CMP      r8,#0                 ;866
0000ea  d1f3              BNE      |L1.212|
0000ec  6829              LDR      r1,[r5,#0]            ;867
0000ee  f8c19014          STR      r9,[r1,#0x14]         ;867
0000f2  6828              LDR      r0,[r5,#0]            ;867
0000f4  6801              LDR      r1,[r0,#0]            ;867
0000f6  4628              MOV      r0,r5                 ;867
0000f8  4788              BLX      r1                    ;867
0000fa  e7ed              B        |L1.216|
;;;876    
                          ENDP


                          AREA ||i.access_virt_sarray||, CODE, READONLY, ALIGN=1

                  access_virt_sarray PROC
;;;718    /* caller intends to modify the accessed area. */
;;;719    METHODDEF(JSAMPARRAY) access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable) {
000000  e92d47f0          PUSH     {r4-r10,lr}
000004  4605              MOV      r5,r0
;;;720      JDIMENSION end_row = start_row + num_rows;
;;;721      JDIMENSION undef_row;
;;;722    
;;;723      /* debugging check */
;;;724      if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
000006  6848              LDR      r0,[r1,#4]
000008  18d7              ADDS     r7,r2,r3              ;720
00000a  f8dd8020          LDR      r8,[sp,#0x20]
00000e  460c              MOV      r4,r1                 ;719
000010  4616              MOV      r6,r2                 ;719
;;;725          ptr->mem_buffer == NULL)
;;;726        ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
000012  f04f0916          MOV      r9,#0x16
000016  42b8              CMP      r0,r7                 ;724
000018  d304              BCC      |L2.36|
00001a  68e0              LDR      r0,[r4,#0xc]          ;724
00001c  4298              CMP      r0,r3                 ;724
00001e  d301              BCC      |L2.36|
000020  6820              LDR      r0,[r4,#0]            ;725
000022  b930              CBNZ     r0,|L2.50|
                  |L2.36|
000024  6829              LDR      r1,[r5,#0]
000026  f8c19014          STR      r9,[r1,#0x14]
00002a  6828              LDR      r0,[r5,#0]
00002c  6801              LDR      r1,[r0,#0]
00002e  4628              MOV      r0,r5
000030  4788              BLX      r1
                  |L2.50|
;;;727    
;;;728      /* Make the desired part of the virtual array accessible */
;;;729      if (start_row < ptr->cur_start_row ||
000032  69a0              LDR      r0,[r4,#0x18]
000034  42b0              CMP      r0,r6
000036  d803              BHI      |L2.64|
;;;730          end_row > ptr->cur_start_row+ptr->rows_in_mem) {
000038  6921              LDR      r1,[r4,#0x10]
00003a  4408              ADD      r0,r0,r1
00003c  42b8              CMP      r0,r7
00003e  d220              BCS      |L2.130|
                  |L2.64|
;;;731        if (! ptr->b_s_open)
000040  6aa0              LDR      r0,[r4,#0x28]
000042  b930              CBNZ     r0,|L2.82|
;;;732          ERREXIT(cinfo, JERR_VIRTUAL_BUG);
000044  6829              LDR      r1,[r5,#0]
000046  2045              MOVS     r0,#0x45
000048  6148              STR      r0,[r1,#0x14]
00004a  6828              LDR      r0,[r5,#0]
00004c  6801              LDR      r1,[r0,#0]
00004e  4628              MOV      r0,r5
000050  4788              BLX      r1
                  |L2.82|
;;;733        /* Flush old buffer contents if necessary */
;;;734        if (ptr->dirty) {
000052  6a60              LDR      r0,[r4,#0x24]
000054  b130              CBZ      r0,|L2.100|
;;;735          do_sarray_io(cinfo, ptr, TRUE);
000056  2201              MOVS     r2,#1
000058  4621              MOV      r1,r4
00005a  4628              MOV      r0,r5
00005c  f7fffffe          BL       do_sarray_io

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?