Changeset 53145c7 in rtems-libbsd
- Timestamp:
- 09/03/18 12:21:14 (6 years ago)
- Branches:
- 5, master
- Children:
- 59951a9
- Parents:
- 0653b1d
- git-author:
- Sebastian Huber <sebastian.huber@…> (09/03/18 12:21:14)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (11/13/19 12:03:49)
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
buildset/default.ini
r0653b1d r53145c7 53 53 netinet6 = on 54 54 netipsec = off 55 nvme = on 55 56 opencrypto = on 56 57 pci = on -
freebsd/sys/dev/nvme/nvme.c
r0653b1d r53145c7 74 74 SYSINIT(nvme_register, SI_SUB_DRIVERS, SI_ORDER_SECOND, nvme_init, NULL); 75 75 76 #ifndef __rtems__ 76 77 static void 77 78 nvme_uninit(void) … … 81 82 82 83 SYSUNINIT(nvme_unregister, SI_SUB_DRIVERS, SI_ORDER_SECOND, nvme_uninit, NULL); 84 #endif /* __rtems__ */ 83 85 84 86 int -
freebsd/sys/dev/nvme/nvme_ctrlr.c
r0653b1d r53145c7 62 62 qpair = &ctrlr->adminq; 63 63 qpair->id = 0; 64 #ifndef __rtems__ 64 65 qpair->cpu = CPU_FFS(&cpuset_domain[ctrlr->domain]) - 1; 65 66 qpair->domain = ctrlr->domain; 67 #endif /* __rtems__ */ 66 68 67 69 num_entries = NVME_ADMIN_ENTRIES; … … 147 149 */ 148 150 qpair->id = i + 1; 151 #ifndef __rtems__ 149 152 if (ctrlr->num_io_queues > 1) { 150 153 /* Find number of CPUs served by this queue. */ … … 158 161 qpair->domain = ctrlr->domain; 159 162 } 163 #endif /* __rtems__ */ 160 164 161 165 /* … … 173 177 */ 174 178 if (ctrlr->num_io_queues > 1) 179 #ifndef __rtems__ 175 180 bus_bind_intr(ctrlr->dev, qpair->res, qpair->cpu); 181 #else /* __rtems__ */ 182 bus_bind_intr(ctrlr->dev, qpair->res, QP(ctrlr, i)); 183 #endif /* __rtems__ */ 176 184 } 177 185 … … 1011 1019 struct nvme_request *req; 1012 1020 struct mtx *mtx; 1021 #ifndef __rtems__ 1013 1022 struct buf *buf = NULL; 1023 #endif /* __rtems__ */ 1014 1024 int ret = 0; 1015 1025 vm_offset_t addr, end; … … 1033 1043 return EIO; 1034 1044 } 1045 #ifndef __rtems__ 1035 1046 if (is_user_buffer) { 1036 1047 /* … … 1050 1061 nvme_pt_done, pt); 1051 1062 } else 1063 #endif /* __rtems__ */ 1052 1064 req = nvme_allocate_request_vaddr(pt->buf, pt->len, 1053 1065 nvme_pt_done, pt); … … 1082 1094 mtx_unlock(mtx); 1083 1095 1096 #ifndef __rtems__ 1084 1097 err: 1085 1098 if (buf != NULL) { … … 1087 1100 PRELE(curproc); 1088 1101 } 1102 #endif /* __rtems__ */ 1089 1103 1090 1104 return (ret); … … 1142 1156 1143 1157 mtx_init(&ctrlr->lock, "nvme ctrlr lock", NULL, MTX_DEF); 1158 #ifndef __rtems__ 1144 1159 if (bus_get_domain(dev, &ctrlr->domain) != 0) 1145 1160 ctrlr->domain = 0; 1161 #endif /* __rtems__ */ 1146 1162 1147 1163 cap_hi = nvme_mmio_read_4(ctrlr, cap_hi); -
freebsd/sys/dev/nvme/nvme_ns.c
r0653b1d r53145c7 50 50 #include "nvme_private.h" 51 51 52 #ifndef __rtems__ 52 53 static void nvme_bio_child_inbed(struct bio *parent, int bio_error); 53 54 static void nvme_bio_child_done(void *arg, … … 64 65 struct bio *bp, 65 66 uint32_t alignment); 67 #endif /* __rtems__ */ 66 68 67 69 static int … … 77 79 78 80 switch (cmd) { 81 #ifndef __rtems__ 79 82 case NVME_IO_TEST: 80 83 case NVME_BIO_TEST: 81 84 nvme_ns_test(ns, cmd, arg); 82 85 break; 86 #endif /* __rtems__ */ 83 87 case NVME_PASSTHROUGH_CMD: 84 88 pt = (struct nvme_pt_command *)arg; … … 126 130 } 127 131 132 #ifndef __rtems__ 128 133 static void 129 134 nvme_ns_strategy_done(void *arg, const struct nvme_completion *cpl) … … 162 167 163 168 } 169 #endif /* __rtems__ */ 164 170 165 171 static struct cdevsw nvme_ns_cdevsw = { 166 172 .d_version = D_VERSION, 167 173 .d_flags = D_DISK, 174 #ifndef __rtems__ 168 175 .d_read = physread, 169 176 .d_write = physwrite, 177 #endif /* __rtems__ */ 170 178 .d_open = nvme_ns_open, 171 179 .d_close = nvme_ns_close, 180 #ifndef __rtems__ 172 181 .d_strategy = nvme_ns_strategy, 182 #endif /* __rtems__ */ 173 183 .d_ioctl = nvme_ns_ioctl 174 184 }; … … 241 251 } 242 252 253 #ifndef __rtems__ 243 254 static void 244 255 nvme_ns_bio_done(void *arg, const struct nvme_completion *status) … … 497 508 return (err); 498 509 } 510 #endif /* __rtems__ */ 499 511 500 512 int -
freebsd/sys/dev/nvme/nvme_ns_cmd.c
r0653b1d r53145c7 53 53 } 54 54 55 #ifndef __rtems__ 55 56 int 56 57 nvme_ns_cmd_read_bio(struct nvme_namespace *ns, struct bio *bp, … … 74 75 return (0); 75 76 } 77 #endif /* __rtems__ */ 76 78 77 79 int … … 94 96 } 95 97 98 #ifndef __rtems__ 96 99 int 97 100 nvme_ns_cmd_write_bio(struct nvme_namespace *ns, struct bio *bp, … … 114 117 return (0); 115 118 } 119 #endif /* __rtems__ */ 116 120 117 121 int -
freebsd/sys/dev/nvme/nvme_pci.c
r0653b1d r53145c7 263 263 device_t dev; 264 264 int force_intx, num_io_queues, per_cpu_io_queues; 265 #ifndef __rtems__ 265 266 int min_cpus_per_ioq; 267 #endif /* __rtems__ */ 266 268 int num_vectors_requested, num_vectors_allocated; 267 269 … … 285 287 num_io_queues = 1; 286 288 289 #ifndef __rtems__ 287 290 min_cpus_per_ioq = smp_threads_per_core; 288 291 TUNABLE_INT_FETCH("hw.nvme.min_cpus_per_ioq", &min_cpus_per_ioq); … … 291 294 max(1, mp_ncpus / min_cpus_per_ioq)); 292 295 } 296 #endif /* __rtems__ */ 293 297 294 298 num_io_queues = min(num_io_queues, pci_msix_count(dev) - 1); -
freebsd/sys/dev/nvme/nvme_private.h
r0653b1d r53145c7 169 169 170 170 uint64_t *prp; 171 #ifndef __rtems__ 171 172 bus_addr_t prp_bus_addr; 173 #else /* __rtems__ */ 174 uint64_t prp_bus_addr; 175 #endif /* __rtems__ */ 172 176 }; 173 177 … … 176 180 struct nvme_controller *ctrlr; 177 181 uint32_t id; 182 #ifndef __rtems__ 178 183 int domain; 179 184 int cpu; 185 #endif /* __rtems__ */ 180 186 181 187 uint16_t vector; … … 241 247 242 248 struct mtx lock; 249 #ifndef __rtems__ 243 250 int domain; 251 #endif /* __rtems__ */ 244 252 uint32_t ready_timeout_in_ms; 245 253 uint32_t quirks; -
freebsd/sys/dev/nvme/nvme_qpair.c
r0653b1d r53145c7 710 710 goto out; 711 711 } 712 #ifndef __rtems__ 712 713 bus_dma_tag_set_domain(qpair->dma_tag, qpair->domain); 714 #endif /* __rtems__ */ 713 715 714 716 if (bus_dmamem_alloc(qpair->dma_tag, (void **)&queuemem, … … 944 946 945 947 if (req->timeout) 948 #ifndef __rtems__ 946 949 callout_reset_on(&tr->timer, ctrlr->timeout_period * hz, 947 950 nvme_timeout, tr, qpair->cpu); 951 #else /* __rtems__ */ 952 callout_reset_on(&tr->timer, ctrlr->timeout_period * hz, 953 nvme_timeout, tr, -1); 954 #endif /* __rtems__ */ 948 955 949 956 /* Copy the command from the tracker to the submission queue. */ … … 1074 1081 nvme_qpair_submit_tracker(tr->qpair, tr); 1075 1082 break; 1083 #ifndef __rtems__ 1076 1084 case NVME_REQUEST_BIO: 1077 1085 KASSERT(req->u.bio->bio_bcount <= qpair->ctrlr->max_xfer_size, … … 1093 1101 "bus_dmamap_load_ccb returned 0x%x!\n", err); 1094 1102 break; 1103 #endif /* __rtems__ */ 1095 1104 default: 1096 1105 panic("unknown nvme request type 0x%x\n", req->type); -
freebsd/sys/sys/malloc.h
r0653b1d r53145c7 186 186 __malloc_like __result_use_check __alloc_size(1) __alloc_align(7); 187 187 void free(void *addr, struct malloc_type *type); 188 #ifndef __rtems__ 188 189 void free_domain(void *addr, struct malloc_type *type); 190 #else /* __rtems__ */ 191 #define free_domain(addr, type) free(addr, type) 192 #endif /* __rtems__ */ 189 193 #ifndef __rtems__ 190 194 void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like … … 251 255 }) 252 256 257 #ifndef __rtems__ 253 258 void *malloc_domainset(size_t size, struct malloc_type *type, 254 259 struct domainset *ds, int flags) __malloc_like __result_use_check 255 260 __alloc_size(1); 261 #else /* __rtems__ */ 262 #define malloc_domainset(size, type, ds, flags) malloc(size, type, flags) 263 #endif /* __rtems__ */ 256 264 void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, 257 265 int flags) __malloc_like __result_use_check
Note: See TracChangeset
for help on using the changeset viewer.