LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: Matjaz Breskvar<phoenix@o...>
    Date: Mon Apr 25 02:14:28 CEST 2005
    Subject: [openrisc] Syscall Argument Passing
    Top
    * Balaji V. Iyer (bviyer@n...) wrote:
    > Hello Everyone,
    >
    > I have a question about how syscalls are handled in OpenRISC 1200. Ok
    > let's say we have to use the _read function, and "read" generally has 3
    > arguements taken in, they are:
    >
    > int read (int fd, char *buffer, int nbyte)
    >
    >
    > How are the values for fd, *buffer and nbyte passed into the function? Are
    > they passed through the parameter registers (r3, r4, r5 respectively,)
    > and the sys function will automatically know these registers to sample? Or
    > are they pushed into the stack with the stack base address stored at a
    > certain place (like the stack pointer, r1)?

    this is defined as part of ABI and implemented
    in linux/include/asm-or32/unistd.h

    loking into that file you'll notice that syscall that takes 3 arguments
    puts them into r3, r4, r5 (just like function call).

    best regards,
    p.

    ReferenceAuthor
    [openrisc] Syscall Argument PassingBalaji V Iyer

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.