Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail From: mitchalsup@aol.com (MitchAlsup1) Newsgroups: comp.arch Subject: Re: stack sizes, Segments Date: Thu, 23 Jan 2025 20:04:49 +0000 Organization: Rocksolid Light Message-ID: References: <20250122152543.00000682@yahoo.com> <20250123014516.00006d99@yahoo.com> <214ed8b743ce4dc75cfec22daa9b8880@www.novabbs.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="811281"; mail-complaints-to="usenet@i2pn2.org"; posting-account="o5SwNDfMfYu6Mv4wwLiW6e/jbA93UAdzFodw5PEa6eU"; User-Agent: Rocksolid Light X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Posting-User: cb29269328a20fe5719ed6a1c397e21f651bda71 X-Rslight-Site: $2y$10$sYen7W7nEb2xi7EdRqc9UePACCtYeVibZ6ozoL82I.x0IUu1dUvwS Bytes: 2959 Lines: 40 On Thu, 23 Jan 2025 19:45:11 +0000, Scott Lurndal wrote: > mitchalsup@aol.com (MitchAlsup1) writes: >>On Thu, 23 Jan 2025 14:00:41 +0000, Scott Lurndal wrote: >> >>> mitchalsup@aol.com (MitchAlsup1) writes: >>>>On Thu, 23 Jan 2025 1:07:02 +0000, Scott Lurndal wrote: >>>> >>> >>>>>>Do you mean "there is no equivlent *POSIX* function", right? >>>>>>But I sincerily hope that most Unix-like systems provide such >>>>>>functionality in system-specific manner. Because it looks usable. >>>>> >>>>> What would an application (portable or otherwise) use the process >>>>> stack base address for? >>>> >>>>As a place to put TLS (or &TLS) on register-starved architectures. >>> >>> That's a function of the implementation, not the programmer. >> >>The compiler needs to know a way of getting TLS in a register starved >>ISA. > > The compiler is part of the "implementation". Very few programmers > work on compilers for register starved architectures (of which few > are still in common use). And very few of them care about the > stack base address. > > >> {This is why segmentation bled over into x86-64} > > Well, it gave them a couple scratch registers for use as > kernel and user-mode thread specific region pointers (fs, gs). > > However, I doubt that played a huge factor in AMD keeping what's > left of 80286 segments, they could have just re-used the > encodings for FS and GS for new GPRs and reserved them for > TLS in ABI's for implementations that support threads. We had long conversations about what to leave in and what to take (back) out.