From: Ben Gras Date: Mon, 18 Jul 2005 12:18:16 +0000 (+0000) Subject: Changed phys_zero to phys_fill, which accepts a 4-byte argument saying what X-Git-Tag: v3.1.0~605 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.host.html?a=commitdiff_plain;h=42e6d20afeedf4914521ff6b903757435bc09061;p=minix.git Changed phys_zero to phys_fill, which accepts a 4-byte argument saying what to fill with. Changed prototype and call to match. --- diff --git a/kernel/klib386.s b/kernel/klib386.s index d23088911..dd551575b 100755 --- a/kernel/klib386.s +++ b/kernel/klib386.s @@ -26,7 +26,7 @@ .define _enable_irq ! enable an irq at the 8259 controller .define _disable_irq ! disable an irq .define _phys_copy ! copy data from anywhere to anywhere in memory -.define _phys_zero ! zero data anywhere in memory +.define _phys_fill ! zero data anywhere in memory .define _mem_rdw ! copy one word from [segment:offset] .define _reset ! reset the system .define _idle_task ! task executed when there is no work @@ -440,14 +440,14 @@ pc_small: ret !*===========================================================================* -!* phys_zero * +!* phys_fill * !*===========================================================================* -! PUBLIC void phys_zero(phys_bytes source, phys_bytes bytecount); +! PUBLIC void phys_fill(phys_bytes source, phys_bytes bytecount, char char); ! Zero a block of physical memory. .align 16 -_phys_zero: +_phys_fill: push ebp mov ebp, esp push esi @@ -457,13 +457,13 @@ _phys_zero: mov eax, 12(ebp) mov ebx, FLAT_DS_SELECTOR mov ds, bx + mov ebx, 16(ebp) shr eax, 2 -zero_start: - mov (esi), 0 +fill_start: + mov (esi), ebx add esi, 4 dec eax - jnz zero_start -zero_done: + jnz fill_start pop ds pop ebx pop esi diff --git a/kernel/proto.h b/kernel/proto.h index ef25c46c0..3e2678e08 100755 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -88,7 +88,7 @@ _PROTOTYPE( int disable_irq, (irq_hook_t *hook) ); _PROTOTYPE( u16_t mem_rdw, (U16_t segm, vir_bytes offset) ); _PROTOTYPE( void phys_copy, (phys_bytes source, phys_bytes dest, phys_bytes count) ); -_PROTOTYPE( void phys_zero, (phys_bytes source, phys_bytes count) ); +_PROTOTYPE( void phys_fill, (phys_bytes source, phys_bytes count, unsigned long pattern) ); _PROTOTYPE( void phys_insb, (U16_t port, phys_bytes buf, size_t count) ); _PROTOTYPE( void phys_insw, (U16_t port, phys_bytes buf, size_t count) ); _PROTOTYPE( void phys_outsb, (U16_t port, phys_bytes buf, size_t count)); diff --git a/kernel/system/do_memset.c b/kernel/system/do_memset.c index 68efcf9e8..b746abfcf 100644 --- a/kernel/system/do_memset.c +++ b/kernel/system/do_memset.c @@ -18,7 +18,7 @@ PUBLIC int do_memset(m_ptr) register message *m_ptr; { /* Handle sys_memset(). */ - phys_zero((phys_bytes) m_ptr->MEM_PTR, (phys_bytes) m_ptr->MEM_COUNT); + phys_fill((phys_bytes) m_ptr->MEM_PTR, (phys_bytes) m_ptr->MEM_COUNT, 0); return(OK); }