Page MenuHomeFreeBSD

Merge the arm, mips, and powerpc copies of the libthr tcb ctor/dtor.
ClosedPublic

Authored by andrew on Jan 19 2015, 3:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Aug 14, 5:19 PM
Unknown Object (File)
Tue, Aug 13, 2:01 PM
Unknown Object (File)
Tue, Aug 13, 2:01 PM
Unknown Object (File)
Tue, Aug 13, 2:01 PM
Unknown Object (File)
Tue, Aug 13, 2:01 PM
Unknown Object (File)
Tue, Aug 13, 2:01 PM
Unknown Object (File)
Tue, Aug 13, 2:01 PM
Unknown Object (File)
Sat, Aug 10, 2:38 AM
Subscribers

Details

Summary

These three architectures have almost identical copies of this file. This
merges them into a single copy.

The old PowerPC version is different as it uses an alignment of 1 where the
other architectures used 16. I have changed this to 16, but am not sure if
this is valid for PowerPC.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

andrew retitled this revision from to Merge the arm, mips, and powerpc copies of the libthr tcb ctor/dtor..
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added a reviewer: emaste.

Hmm, the trivial_ prefix made sense for getcontextx I think because it did indeed implement a trivial version. I wonder though if we should instead use common_ for these cases, since some of the shared files may not be trivial.

andrew edited edge metadata.

Mere all copies of pthread_md.c in to a single file based on sparc64.

The amd64 and i386 copies had asm to get the tcb. I replaced this with
_tcb_get() and checked before and after and found the object files were
identical.

The arm, mips, and powerpc _rtld_allocate_tls will return the first
argument if it's non-null. _tcb_get() will return the pointer to the tcb
on the initial thread so this will be returned.

I do not see much sense in calling the file xxx_md.c when it is mi. Call it pthread_ctrdtr.c and move to libthr/thread directory ?

In D1556#5, @emaste wrote:

Hmm, the trivial_ prefix made sense for getcontextx I think because it did indeed implement a trivial version. I wonder though if we should instead use common_ for these cases, since some of the shared files may not be trivial.

I don't mind what it's called. It would make sense to name it common_pthread.c or something similar now it looks like all copies can be merged.

In D1556#9, @andrew wrote:

I don't mind what it's called. It would make sense to name it common_pthread.c or something similar now it looks like all copies can be merged.

@kostikbel's suggestion sounds good to me.

In D1556#8, @kostikbel wrote:

I do not see much sense in calling the file xxx_md.c when it is mi. Call it pthread_ctrdtr.c and move to libthr/thread directory ?

Sure, we can move it there, although should it be something like thr_ctrdtr.c in that case? All other source files in that directory use the thr_ prefix.

Also, to finish the cleanup, copies of the prototypes for tcb_ctor and dtor should be moved to thr_private.h.

  • Move the common file to libthr/thread/thr_ctrdtr.c
  • Move the prototypes to thr_private.h
lib/libthr/Makefile
47 ↗(On Diff #3264)

Is this directory needed still ?

lib/libthr/Makefile
47 ↗(On Diff #3264)

No, I'll remove it from the committed patch.

Remove the reference to arch/common

kib added a reviewer: kib.
This revision is now accepted and ready to land.Jan 21 2015, 4:16 PM
andrew updated this revision to Diff 3293.

Closed by commit rS277490 (authored by @andrew).