+#if !defined (__x86_64__)
+/*
+ * Register an additional buffer with data to include in the panic log
+ *
+ * <rdar://problem/50137705> tracks supporting more than one buffer
+ *
+ * Note that producer_name and buf should never be de-allocated as we reference these during panic.
+ */
+void
+register_additional_panic_data_buffer(const char *producer_name, void *buf, int len)
+{
+ if (panic_data_buffers != NULL) {
+ panic("register_additional_panic_data_buffer called with buffer already registered");
+ }
+
+ if (producer_name == NULL || (strlen(producer_name) == 0)) {
+ panic("register_additional_panic_data_buffer called with invalid producer_name");
+ }
+
+ if (buf == NULL) {
+ panic("register_additional_panic_data_buffer called with invalid buffer pointer");
+ }
+
+ if ((len <= 0) || (len > ADDITIONAL_PANIC_DATA_BUFFER_MAX_LEN)) {
+ panic("register_additional_panic_data_buffer called with invalid length");
+ }
+
+ struct additional_panic_data_buffer *new_panic_data_buffer = kalloc(sizeof(struct additional_panic_data_buffer));
+ new_panic_data_buffer->producer_name = producer_name;
+ new_panic_data_buffer->buf = buf;
+ new_panic_data_buffer->len = len;
+
+ if (!OSCompareAndSwapPtr(NULL, new_panic_data_buffer, &panic_data_buffers)) {
+ panic("register_additional_panic_data_buffer called with buffer already registered");
+ }
+
+ return;
+}
+#endif /* !defined (__x86_64__) */
+