osint-c.ads: Minor comment update.
2015-10-26 Arnaud Charlet <charlet@adacore.com> * osint-c.ads: Minor comment update. 2015-10-26 Arnaud Charlet <charlet@adacore.com> * s-osinte-hpux.ads, s-osinte-aix.ads, s-osinte-solaris-posix.ads, s-osinte-darwin.ads, s-osinte-android.ads, s-osinte-freebsd.ads, s-taprop-posix.adb (Get_Page_Size): C function returns an int. Adjust callers accordingly. From-SVN: r229342
This commit is contained in:
parent
356ffab8a2
commit
b204e984c7
|
@ -1,3 +1,14 @@
|
||||||
|
2015-10-26 Arnaud Charlet <charlet@adacore.com>
|
||||||
|
|
||||||
|
* osint-c.ads: Minor comment update.
|
||||||
|
|
||||||
|
2015-10-26 Arnaud Charlet <charlet@adacore.com>
|
||||||
|
|
||||||
|
* s-osinte-hpux.ads, s-osinte-aix.ads, s-osinte-solaris-posix.ads,
|
||||||
|
s-osinte-darwin.ads, s-osinte-android.ads, s-osinte-freebsd.ads,
|
||||||
|
s-taprop-posix.adb (Get_Page_Size): C function returns an int. Adjust
|
||||||
|
callers accordingly.
|
||||||
|
|
||||||
2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>
|
2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>
|
||||||
|
|
||||||
* exp_ch4.adb (Is_OK_Object_Reference): New routine.
|
* exp_ch4.adb (Is_OK_Object_Reference): New routine.
|
||||||
|
|
|
@ -111,8 +111,7 @@ package Osint.C is
|
||||||
procedure Set_File_Name (Ext : String);
|
procedure Set_File_Name (Ext : String);
|
||||||
-- Sets a default file name from the main compiler source name. Ext is the
|
-- Sets a default file name from the main compiler source name. Ext is the
|
||||||
-- extension, e.g. "ali" for a library information file. The name is in
|
-- extension, e.g. "ali" for a library information file. The name is in
|
||||||
-- Name_Buffer (with length in Name_Len) on return. This is visible in
|
-- Name_Buffer (with length in Name_Len) on return.
|
||||||
-- the spec since it used directly by clients in the .Net case.
|
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Library Information Output --
|
-- Library Information Output --
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- S p e c --
|
-- S p e c --
|
||||||
-- --
|
-- --
|
||||||
-- Copyright (C) 1991-1994, Florida State University --
|
-- Copyright (C) 1991-1994, Florida State University --
|
||||||
-- Copyright (C) 1995-2014, Free Software Foundation, Inc. --
|
-- Copyright (C) 1995-2015, Free Software Foundation, Inc. --
|
||||||
-- --
|
-- --
|
||||||
-- GNAT is free software; you can redistribute it and/or modify it under --
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
||||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||||
|
@ -319,8 +319,7 @@ package System.OS_Interface is
|
||||||
-- Returns the stack base of the specified thread. Only call this function
|
-- Returns the stack base of the specified thread. Only call this function
|
||||||
-- when Stack_Base_Available is True.
|
-- when Stack_Base_Available is True.
|
||||||
|
|
||||||
function Get_Page_Size return size_t;
|
function Get_Page_Size return int;
|
||||||
function Get_Page_Size return Address;
|
|
||||||
pragma Import (C, Get_Page_Size, "getpagesize");
|
pragma Import (C, Get_Page_Size, "getpagesize");
|
||||||
-- Returns the size of a page
|
-- Returns the size of a page
|
||||||
|
|
||||||
|
|
|
@ -317,8 +317,7 @@ package System.OS_Interface is
|
||||||
return Address is (Null_Address);
|
return Address is (Null_Address);
|
||||||
-- This is a dummy procedure to share some GNULLI files
|
-- This is a dummy procedure to share some GNULLI files
|
||||||
|
|
||||||
function Get_Page_Size return size_t;
|
function Get_Page_Size return int;
|
||||||
function Get_Page_Size return Address;
|
|
||||||
pragma Import (C, Get_Page_Size, "_getpagesize");
|
pragma Import (C, Get_Page_Size, "_getpagesize");
|
||||||
-- Returns the size of a page
|
-- Returns the size of a page
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- S p e c --
|
-- S p e c --
|
||||||
-- --
|
-- --
|
||||||
-- Copyright (C) 1991-1994, Florida State University --
|
-- Copyright (C) 1991-1994, Florida State University --
|
||||||
-- Copyright (C) 1995-2014, Free Software Foundation, Inc. --
|
-- Copyright (C) 1995-2015, Free Software Foundation, Inc. --
|
||||||
-- --
|
-- --
|
||||||
-- GNAT is free software; you can redistribute it and/or modify it under --
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
||||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||||
|
@ -299,8 +299,7 @@ package System.OS_Interface is
|
||||||
-- returns the stack base of the specified thread. Only call this function
|
-- returns the stack base of the specified thread. Only call this function
|
||||||
-- when Stack_Base_Available is True.
|
-- when Stack_Base_Available is True.
|
||||||
|
|
||||||
function Get_Page_Size return size_t;
|
function Get_Page_Size return int;
|
||||||
function Get_Page_Size return System.Address;
|
|
||||||
pragma Import (C, Get_Page_Size, "getpagesize");
|
pragma Import (C, Get_Page_Size, "getpagesize");
|
||||||
-- Returns the size of a page
|
-- Returns the size of a page
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- S p e c --
|
-- S p e c --
|
||||||
-- --
|
-- --
|
||||||
-- Copyright (C) 1991-1994, Florida State University --
|
-- Copyright (C) 1991-1994, Florida State University --
|
||||||
-- Copyright (C) 1995-2014, Free Software Foundation, Inc. --
|
-- Copyright (C) 1995-2015, Free Software Foundation, Inc. --
|
||||||
-- --
|
-- --
|
||||||
-- GNAT is free software; you can redistribute it and/or modify it under --
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
||||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||||
|
@ -332,8 +332,7 @@ package System.OS_Interface is
|
||||||
-- returns the stack base of the specified thread. Only call this function
|
-- returns the stack base of the specified thread. Only call this function
|
||||||
-- when Stack_Base_Available is True.
|
-- when Stack_Base_Available is True.
|
||||||
|
|
||||||
function Get_Page_Size return size_t;
|
function Get_Page_Size return int;
|
||||||
function Get_Page_Size return Address;
|
|
||||||
pragma Import (C, Get_Page_Size, "getpagesize");
|
pragma Import (C, Get_Page_Size, "getpagesize");
|
||||||
-- Returns the size of a page
|
-- Returns the size of a page
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- S p e c --
|
-- S p e c --
|
||||||
-- --
|
-- --
|
||||||
-- Copyright (C) 1991-1994, Florida State University --
|
-- Copyright (C) 1991-1994, Florida State University --
|
||||||
-- Copyright (C) 1995-2014, Free Software Foundation, Inc. --
|
-- Copyright (C) 1995-2015, Free Software Foundation, Inc. --
|
||||||
-- --
|
-- --
|
||||||
-- GNAT is free software; you can redistribute it and/or modify it under --
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
||||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||||
|
@ -301,8 +301,7 @@ package System.OS_Interface is
|
||||||
-- Returns the stack base of the specified thread. Only call this function
|
-- Returns the stack base of the specified thread. Only call this function
|
||||||
-- when Stack_Base_Available is True.
|
-- when Stack_Base_Available is True.
|
||||||
|
|
||||||
function Get_Page_Size return size_t;
|
function Get_Page_Size return int;
|
||||||
function Get_Page_Size return Address;
|
|
||||||
pragma Import (C, Get_Page_Size, "getpagesize");
|
pragma Import (C, Get_Page_Size, "getpagesize");
|
||||||
-- Returns the size of a page
|
-- Returns the size of a page
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- S p e c --
|
-- S p e c --
|
||||||
-- --
|
-- --
|
||||||
-- Copyright (C) 1991-1994, Florida State University --
|
-- Copyright (C) 1991-1994, Florida State University --
|
||||||
-- Copyright (C) 1995-2014, Free Software Foundation, Inc. --
|
-- Copyright (C) 1995-2015, Free Software Foundation, Inc. --
|
||||||
-- --
|
-- --
|
||||||
-- GNAT is free software; you can redistribute it and/or modify it under --
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
||||||
-- terms of the GNU General Public License as published by the Free Soft- --
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
||||||
|
@ -300,8 +300,7 @@ package System.OS_Interface is
|
||||||
-- Returns the stack base of the specified thread. Only call this function
|
-- Returns the stack base of the specified thread. Only call this function
|
||||||
-- when Stack_Base_Available is True.
|
-- when Stack_Base_Available is True.
|
||||||
|
|
||||||
function Get_Page_Size return size_t;
|
function Get_Page_Size return int;
|
||||||
function Get_Page_Size return Address;
|
|
||||||
pragma Import (C, Get_Page_Size, "getpagesize");
|
pragma Import (C, Get_Page_Size, "getpagesize");
|
||||||
-- Returns the size of a page
|
-- Returns the size of a page
|
||||||
|
|
||||||
|
|
|
@ -315,21 +315,20 @@ package body System.Task_Primitives.Operations is
|
||||||
|
|
||||||
procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is
|
procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is
|
||||||
Stack_Base : constant Address := Get_Stack_Base (T.Common.LL.Thread);
|
Stack_Base : constant Address := Get_Stack_Base (T.Common.LL.Thread);
|
||||||
Guard_Page_Address : Address;
|
Page_Size : Address;
|
||||||
|
Res : Interfaces.C.int;
|
||||||
Res : Interfaces.C.int;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if Stack_Base_Available then
|
if Stack_Base_Available then
|
||||||
|
|
||||||
-- Compute the guard page address
|
-- Compute the guard page address
|
||||||
|
|
||||||
Guard_Page_Address :=
|
Page_Size := Address (Get_Page_Size);
|
||||||
Stack_Base - (Stack_Base mod Get_Page_Size) + Get_Page_Size;
|
|
||||||
|
|
||||||
Res :=
|
Res :=
|
||||||
mprotect (Guard_Page_Address, Get_Page_Size,
|
mprotect
|
||||||
prot => (if On then PROT_ON else PROT_OFF));
|
(Stack_Base - (Stack_Base mod Page_Size) + Page_Size,
|
||||||
|
size_t (Page_Size),
|
||||||
|
prot => (if On then PROT_ON else PROT_OFF));
|
||||||
pragma Assert (Res = 0);
|
pragma Assert (Res = 0);
|
||||||
end if;
|
end if;
|
||||||
end Stack_Guard;
|
end Stack_Guard;
|
||||||
|
@ -978,7 +977,8 @@ package body System.Task_Primitives.Operations is
|
||||||
is
|
is
|
||||||
Attributes : aliased pthread_attr_t;
|
Attributes : aliased pthread_attr_t;
|
||||||
Adjusted_Stack_Size : Interfaces.C.size_t;
|
Adjusted_Stack_Size : Interfaces.C.size_t;
|
||||||
Page_Size : constant Interfaces.C.size_t := Get_Page_Size;
|
Page_Size : constant Interfaces.C.size_t :=
|
||||||
|
Interfaces.C.size_t (Get_Page_Size);
|
||||||
Result : Interfaces.C.int;
|
Result : Interfaces.C.int;
|
||||||
|
|
||||||
function Thread_Body_Access is new
|
function Thread_Body_Access is new
|
||||||
|
|
Loading…
Reference in New Issue