Changeset 9756131 in mainline


Ignore:
Timestamp:
2005-08-31T10:00:14Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b9e97fb
Parents:
3de9e5e
Message:

Get rid of memcopy().
All we now have is memcpy() and _memcpy().
memcpy() is defined to be builtin.
Where not applicable, architectures must implement memcpy() code or call slowish _memcopy().

Files:
15 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/dummy.s

    r3de9e5e r9756131  
    5151.global dummy
    5252.global asm_delay_loop
     53.global memcpy
    5354
    5455cpu_priority_high:
     
    7475page_arch_init:
    7576frame_arch_init:
     77memcpy:
    7678
    7779dummy:
  • arch/amd64/src/supplib.c

    r3de9e5e r9756131  
    3131/* TODO: Rewrite to assembler */
    3232
    33 char *memcpy(void *dst, const void *src, size_t cnt)
    34 {
    35         _memcopy(dst, src, cnt);
    36 }
    37 
    38 char *memcopy(void * dst, const void *src, size_t cnt)
    39 {
    40         _memcopy(dst, src, cnt);
    41 }
    42 
    4333void memsetw(__address dst, size_t cnt, __u16 x)
    4434{
  • arch/ia32/src/asm.S

    r3de9e5e r9756131  
    4444.global outw
    4545.global outl
    46 .global memcopy
     46.global memcpy
    4747.global memsetb
    4848.global memsetw
     
    266266DST=8
    267267CNT=16
    268 memcopy:
     268memcpy:
    269269        push %ebp
    270270        movl %esp,%ebp
  • arch/ia32/src/drivers/ega.c

    r3de9e5e r9756131  
    7474                return;
    7575
    76         memcopy((void *)PA2KA(VIDEORAM),(void *)(PA2KA(VIDEORAM) + ROW*2), (SCREEN - ROW)*2); //swaped
     76        memcpy((void *)PA2KA(VIDEORAM), (void *)(PA2KA(VIDEORAM) + ROW*2), (SCREEN - ROW)*2);
    7777        memsetw(PA2KA(VIDEORAM) + (SCREEN - ROW)*2, ROW, 0x0720);
    7878        ega_cursor = ega_cursor - ROW;
  • arch/ia32/src/mm/page.c

    r3de9e5e r9756131  
    7373
    7474                dba = frame_alloc(FRAME_KA | FRAME_PANIC);
    75                 memcopy((void *)dba,(void *)bootstrap_dba , PAGE_SIZE); //swaped
     75                memcpy((void *)dba, (void *)bootstrap_dba , PAGE_SIZE);
    7676                write_cr3(KA2PA(dba));
    7777        }
  • arch/ia32/src/smp/mps.c

    r3de9e5e r9756131  
    313313#ifdef MPSCT_VERBOSE
    314314        char buf[7];
    315         memcopy((void *) buf, (void *) bus->bus_type, 6);
     315        memcpy((void *) buf, (void *) bus->bus_type, 6);
    316316        buf[6] = 0;
    317317        printf("bus%d: %s\n", bus->bus_id, buf);
  • arch/ia32/src/smp/smp.c

    r3de9e5e r9756131  
    140140                        panic("couldn't allocate memory for GDT\n");
    141141
    142                 memcopy(gdt_new, gdt, GDT_ITEMS*sizeof(struct descriptor));           // swaped
     142                memcpy(gdt_new, gdt, GDT_ITEMS*sizeof(struct descriptor));
    143143                memsetb((__address)(&gdt_new[TSS_DES]), sizeof(struct descriptor), 0);
    144144                gdtr.base = KA2PA((__address) gdt_new);
  • arch/ia64/src/asm.S

    r3de9e5e r9756131  
    3131.global memcpy
    3232memcpy:
    33         /*
    34          * Switch the role of first two arguments
    35          */
    36         sub r33 = r33, r32      ;;
    37         add r32 = r32, r33      ;;
    38         sub r33 = r32, r33     
    39                
    40         br _memcopy
    41 
    42 .global memcopy
    43 memcopy:
    44         br _memcopy
     33        br _memcpy
    4534
    4635.global memsetb
  • arch/mips/src/asm.s

    r3de9e5e r9756131  
    151151        nop
    152152
    153 .global memcopy
    154 memcopy:
    155         j _memcopy
     153.global memcpy
     154memcpy:
     155        j _memcpy
    156156        nop
    157157
  • arch/ppc/src/dummy.s

    r3de9e5e r9756131  
    3030
    3131.global memcpy
    32 .global memcopy
    3332.global cpu_priority_read
    3433.global memsetb
     
    4746
    4847memcpy:
    49 memcopy:
    5048cpu_priority_read:
    5149memsetb:
  • include/memstr.h

    r3de9e5e r9756131  
    3333#include <arch/types.h>
    3434
    35 extern char *memcpy(void * dst, const void *src, size_t cnt);
    36 extern char *memcopy(void * dst, const void *src, size_t cnt);
     35#define memcpy(dst, src, cnt)   __builtin_memcpy((dst), (src), (cnt));
    3736
    3837extern void memsetw(__address dst, size_t cnt, __u16 x);
     
    4443 * Architecture independent variants.
    4544 */
    46 extern char *_memcopy(void *dst, const void *src, size_t cnt);
     45extern char *_memcpy(void *dst, const void *src, size_t cnt);
    4746extern void _memsetb(__address dst, size_t cnt, __u8 x);
    4847extern void _memsetw(__address dst, size_t cnt, __u16 x);
  • src/lib/memstr.c

    r3de9e5e r9756131  
    4242 *
    4343 */
    44 char *_memcopy(void * dst, const void *src, size_t cnt)
     44char *_memcpy(void * dst, const void *src, size_t cnt)
    4545{
    4646        int i;
     
    5151        return (char *)src;
    5252}
    53 
    5453
    5554/** Fill block of memory
  • src/main/kinit.c

    r3de9e5e r9756131  
    132132        if (!a) panic("vm_area_create: vm_text");
    133133        vm_area_map(a, m);
    134         memcopy(PA2KA(a->mapping[0]), (__address) utext, utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE);
     134        memcpy((void *) PA2KA(a->mapping[0]), (void *) utext, utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE);
    135135
    136136        /*
  • src/mm/vm.c

    r3de9e5e r9756131  
    6767                        src_ptl0 = (pte_t *) PA2KA((__address) GET_PTL0_ADDRESS());
    6868                        dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC);
    69                         memcopy((void *)PA2KA((__address) dst_ptl0), (void *)GET_PTL0_ADDRESS() , PAGE_SIZE);
     69                        memcpy((void *)PA2KA((__address) dst_ptl0), (void *)GET_PTL0_ADDRESS() , PAGE_SIZE);
    7070                        m->ptl0 = (pte_t *) KA2PA((__address) dst_ptl0);
    7171                }
  • test/synch/rwlock4/test.c

    r3de9e5e r9756131  
    3434#include <arch/types.h>
    3535#include <arch/context.h>
     36#include <context.h>
    3637#include <panic.h>
    3738
Note: See TracChangeset for help on using the changeset viewer.