'pseudo-device dt' on macppc

2022-01-17 Thread Andrew Krasavin

Hello!

Is there a reason not to enable dt(4) on macppc by default? I have
built a kernel with dt enabled for test purposes and it seems to work
correctly - commands like 'btrace /usr/share/btrace/kprofile.bt'
work and I get stacks.

Maybe I'm missing something and there are known problems? But if
not - maybe dt(4) should be enabled by default on macppc?

The diff I used is obvious, but anyway:

--- sys/arch/macppc/conf/GENERIC.orig
+++ sys/arch/macppc/conf/GENERIC
@@ -406,4 +406,6 @@ owtemp* at onewire? # Temperature
 owctr* at onewire? # Counter device
 
 pseudo-device  hotplug 1   # devices hot plugging

+pseudo-device  dt
+
 pseudo-device  wsmux   2   # mouse & keyboard multiplexor

In any case - thanks.
--
Wbr, Andrew Krasavin



Re: : provide ElfW() macro

2021-12-18 Thread Andrew Krasavin

On Fri, Dec 17, 2021 at 01:04:35PM +, Klemens Nanni wrote:

An upcoming port uses ElfW().  I first patched the port, but looking
around shows that both NetBSD and FreeBSD adopted the macro:

https://mail-index.netbsd.org/source-changes-hg/2018/07/31/msg027523.html
+#defineElfW(x) CONCAT(Elf,CONCAT(ELFSIZE,CONCAT(_,x)))

https://cgit.freebsd.org/src/commit/sys/sys/elf_generic.h?id=34e7e4b6a059eee5e4e3e34de5b9d5f0d6e589f9
+/* Define ElfW for compatibility with Linux, prefer __ElfN() in FreeBSD code */
+#defineElfW(x) __ElfN(x)

So I suggest providing it as well.

I have yet to put this through a release build on amd64 and/or sparc64
to check if there is any fallout, but I don't suspect there will be.

Feedback? Objections? OK (given the build succeeds)?


Index: sys/sys/exec_elf.h
===
RCS file: /cvs/src/sys/sys/exec_elf.h,v
retrieving revision 1.93
diff -u -p -r1.93 exec_elf.h
--- sys/sys/exec_elf.h  7 Dec 2021 22:17:03 -   1.93
+++ sys/sys/exec_elf.h  17 Dec 2021 12:36:39 -
@@ -725,6 +725,7 @@ struct elf_args {
#define CONCAT(x,y) __CONCAT(x,y)
#define ELFNAME(x)  CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
#define ELFDEFNNAME(x)  CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
+#define ElfW(x)CONCAT(Elf,CONCAT(ELFSIZE,CONCAT(_,x)))
#endif

#if defined(ELFSIZE) && (ELFSIZE == 32)



The code that requires this macro in sys/sys/exec_elf.h was
eventually removed from the upcoming port (devel/abseil-cpp).

I have no opinion on what you should do with this patch now, but
I feel it is necessary to report that this change is no longer
needed for my port.

--
Wbr, Andrew Krasavin