From owner-freebsd-hackers@freebsd.org Tue May 23 13:55:09 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F771D7A66C for ; Tue, 23 May 2017 13:55:09 +0000 (UTC) (envelope-from karnajitw@gmail.com) Received: from mail-qk0-x22a.google.com (mail-qk0-x22a.google.com [IPv6:2607:f8b0:400d:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52614179A for ; Tue, 23 May 2017 13:55:09 +0000 (UTC) (envelope-from karnajitw@gmail.com) Received: by mail-qk0-x22a.google.com with SMTP id u75so130341858qka.3 for ; Tue, 23 May 2017 06:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ipsouqz7YYRBJehuECEpeeTz3nMiPAToxEtcjYBJnsM=; b=FvS3ESeRmjvm/w0GYLZ5UKVh12gWjXnLtOE7XOKHO+cNX0hqGNivkeJkwvC7/35893 cBQyB1HOKPiBuAQS6u/fdzuOPcdF8wOdbwhyQ63mSFzd7RfcG/wpTniPZk5iHiBAfUNd dOD3uTTs+3ppGfNmDefRXuRyzr93NWBPDvpLFlkewzCd+qX6a71jpXgSObjF4BfAd+61 Pq3m/N5QQ9iPDk+Wz72pK7fRi5B8wTjSUWfZPZ0UT22r8Bin8v4drllMvAm08pZ/eKim l7W23kYivn+szjxxbszViqMyMAk9nGM+Qjs8D3ooYMnUkWXqxa4GvvibIviTTz6+rnCF 1MkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ipsouqz7YYRBJehuECEpeeTz3nMiPAToxEtcjYBJnsM=; b=TuvECJ+nXYIZgcDQRktMFQ14DPYfBczWwGnR9h3zc3oK/Fhm2iNqxw3vCrJRW32B3b 8qxLulotHDTaoaYpdoiOHOrx7jWt3ImARGc0C2OgfBkwPjBd+efh2U/FERG+LE9w4AYu 1/S2g97bg/V/aoPlUb15lezJHj/CSsS6vVw8mAOCa64So8vpfzmSGEdLEAfYuzYRAwSw iTz4P/BsHw+FygVGRSLjAMRhTN5FJuz3GqpS3UYnVZYqpLdz0QQpIfZfcXppXyD4jdH7 HGfdvVs2XqfLdKhQZSX20VdJTCHWXlw2G9D5Sn2NKgy0heEtd3TiNgdp+sS7M5YgSMvS Ryaw== X-Gm-Message-State: AODbwcB7SDzDXNT/8oCf8DDMDUKTKhOyOzqix2CGFkqOyOxYYJ3PpsLu +/WSj2MOyV+s4jkcYPUUvFzfCt/SxAV6 X-Received: by 10.55.221.8 with SMTP id n8mr24842146qki.103.1495547708208; Tue, 23 May 2017 06:55:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.49.85 with HTTP; Tue, 23 May 2017 06:55:07 -0700 (PDT) From: karnajit wangkhem Date: Tue, 23 May 2017 19:25:07 +0530 Message-ID: Subject: Seventh argument seen in mmap on i386 To: freebsd-hackers@freebsd.org X-Mailman-Approved-At: Tue, 23 May 2017 13:59:58 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 May 2017 13:55:09 -0000 Hi All, I am trying to understand this scenario where a seventh argument is seen in case of freebsd.x-i386. As per the mmap man page, the libc function prototype takes in 6 arguments. Ktrace shows the following // Freebsd-11.0 =E2=80=93 i386 box 44416 a.out CALL mmap(0,0x1000,0x7,0x1002,0xffffffff,0,0) 44416 a.out RET mmap 671535104/0x2806d000 // Freebsd-11.0 =E2=80=93 amd64 box 366 a.out CALL mmap(0,0x1000,0x7,0x1002,0xffffffff,0) 366 a.out RET mmap 34366287872/0x80063f000 Also, the disassemble code show that an extra argument was pushed in i386 case -> 0x80485e6 <+38>: movl %esp, %ebx 0x80485e8 <+40>: movl $0x0, 0x18(%ebx) 0x80485ef <+47>: movl $0x0, 0x14(%ebx) 0x80485f6 <+54>: movl $0xffffffff, 0x10(%ebx) ; imm =3D 0xFFFFFFFF 0x80485fd <+61>: movl $0x1002, 0xc(%ebx) ; imm =3D 0x1002 0x8048604 <+68>: movl $0x7, 0x8(%ebx) 0x804860b <+75>: movl $0x1000, 0x4(%ebx) ; imm =3D 0x1000 0x8048612 <+82>: movl $0x0, (%ebx) Please help me understand why this extra argument is seen in case of i386. Regards, Karan