Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  __bionic_clone.S

  Sprache: Sparc
 

#include <private/bionic_asm.h>

// pid_t __bionic_clone(int flags, void* child_stack, pid_t* parent_tid, void* tls, pid_t* child_tid, int (*fn)(void*), void* arg);
ENTRY_PRIVATE(__bionic_clone)
        pushl   %ebx
        .cfi_adjust_cfa_offset 4
        .cfi_rel_offset ebx, 0
        pushl   %esi
        .cfi_adjust_cfa_offset 4
        .cfi_rel_offset esi, 0
        pushl   %edi
        .cfi_adjust_cfa_offset 4
        .cfi_rel_offset edi, 0

        # Load system call arguments into registers.
        movl    16(%esp), %ebx   # flags
        movl    20(%esp), %ecx   # child_stack
        movl    24(%esp), %edx   # parent_tid
        movl    28(%esp), %esi   # tls
        movl    32(%esp), %edi   # child_tid

        # Copy 'fn' and 'arg' onto the child stack
        movl    36(%esp), %eax   # Read 'fn'.
        movl    %eax, -16(%ecx)  # Write 'fn'.
        movl    40(%esp), %eax   # Read 'arg'.
        movl    %eax, -12(%ecx)  # Write 'arg'.
        subl    $16, %ecx

        # Make the system call.
        movl    $__NR_clone, %eax
        int     $0x80

        # Check result.
        testl    %eax, %eax
        jz      L(child)
        jg      L(parent)

        # An error occurred, so set errno and return -1.
        pushl   %eax
        call    __set_errno_internal
        addl    $4, %esp
        jmp     L(return)

L(child):
        # We don't want anyone to unwind past this point.
        .cfi_undefined %eip
        .cfi_undefined %ebp
        xorl    %ebp, %ebp
        call    __start_thread
        hlt

L(parent):
        # We're the parent; nothing to do.
L(return):
        popl    %edi
        .cfi_adjust_cfa_offset -4
        .cfi_restore edi
        popl    %esi
        .cfi_adjust_cfa_offset -4
        .cfi_restore esi
        popl    %ebx
        .cfi_adjust_cfa_offset -4
        .cfi_restore ebx
        ret
END(__bionic_clone)

// pid_t __bionic_clone3(struct clone_args* cl_args, size_t size, int (*fn)(void*), void* arg);
ENTRY_PRIVATE(__bionic_clone3)
        pushl   %ebx
        .cfi_adjust_cfa_offset 4
        .cfi_rel_offset ebx, 0
        pushl   %esi
        .cfi_adjust_cfa_offset 4
        .cfi_rel_offset esi, 0
        pushl   %edi
        .cfi_adjust_cfa_offset 4
        .cfi_rel_offset edi, 0

        # Load system call arguments into registers.
        movl    16(%esp), %ebx   # cl_args
        movl    20(%esp), %ecx   # size

        # The child stack pointer accessed through `cl_args` points to the top
        # of the memory region. Rather than duplicate the kernel's stack
        # alignment we will store the values in register that won't be
        # clobbered by the system call and then push them onto the child stack
        # before calling __start_thread.
        movl    24(%esp), %esi  # Copy 'fn'.
        movl    28(%esp), %edi  # Copy 'arg'.

        # Make the system call.
        movl    $__NR_clone3, %eax
        int     $0x80

        # Check result.
        testl    %eax, %eax
        jz      L(bc3_child)
        jg      L(bc3_parent)

        # An error occurred, so set errno and return -1.
        pushl   %eax
        call    __set_errno_internal
        addl    $4, %esp
        jmp     L(bc3_return)

L(bc3_child):
        # We don't want anyone to unwind past this point.
        .cfi_undefined %eip
        .cfi_undefined %ebp
        xorl %ebp, %ebp

        pushl   %edi  # Push 'arg'
        pushl   %esi  # Push 'fn'
        call    __start_thread
        hlt

L(bc3_parent):
        # We're the parent; nothing to do.
L(bc3_return):
        popl    %edi
        .cfi_adjust_cfa_offset -4
        .cfi_restore edi
        popl    %esi
        .cfi_adjust_cfa_offset -4
        .cfi_restore esi
        popl    %ebx
        .cfi_adjust_cfa_offset -4
        .cfi_restore ebx
        ret
END(__bionic_clone3)

Messung V0.5 in Prozent
C=90 H=99 G=94

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet am  2026-06-28) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik